CALGARY, Alberta -- The Anaheim Ducks were not going to be embarrassed again.
Two weeks after suffering a lopsided loss at the Scotiabank Saddledome, the Ducks erased a one-goal deficit Wednesday and emerged with a 3-2, come-from-behind victory over the Calgary Flames.
Centers Nick Bonino, Mathieu Perreault and Andrew Cogliano scored for the Ducks, who are now two points back of the first-place San Jose Sharks in Pacific Division. Anaheim (47-18-7) has two games in hand.
Not only did the Ducks gain some valuable ground on the Sharks, but they also erased the memories of a 7-2 drubbing from the Flames in the same building on March 12.
"The whole team was upset with what happened last time," Ducks goalie Jonas Hiller said. "It's nice if you get a chance pretty quick to do better, and I'm definitely happy with the way we responded and the way I responded. I thought we played a pretty good road game."
The Ducks officially clinched a playoff spot Tuesday night thanks to a loss by the Dallas Stars, but they are more worried about tracking down San Jose.
"Coming down the stretch, we play a couple teams that are already out of the playoffs. We have to take advantage of those games," Perreault said.
The Flames, who are not in the postseason picture but have earned a reputation as one of the NHL's hardest-working squads, made the Ducks earn their two points Wednesday.
Right wingers Brian McGrattan and Jiri Hudler provided the offense for the Flames, who had a 2-1 lead after 40 minutes but couldn't seal the deal.
After allowing three goals on five shots before getting the hook on his last trip to Calgary, Hiller finished with 32 saves Wednesday. Flames netminder Karri Ramo made 31 stops.
"I believe that the story of this game is two teams that worked very hard," Flames coach Bob Hartley said. "In the third period, they got two good breaks and they deserved them because they worked as hard as us.
"That's the beauty of this game -- sometimes you get the breaks, and sometimes you don't get the breaks. I can't fault the effort. I felt that we played a very good game."
The Flames (30-36-7) had a handful of solid opportunities to open the scoring, but it was the Ducks who struck first on the power play.
With Flames defenseman Ladislav Smid seated for an illegal hit to the head on Ducks right winger Tim Jackman, Bonino cruised into Calgary's zone and fired a shot over Ramo's shoulder for the only goal of the first period.
McGrattan, who was skating in his 300th NHL game, tied it up at the 4:44 mark of the middle frame, getting some luck after defenseman Tyler Wotherspoon's shot bounced off fellow forward Kevin Westgarth and then off McGrattan as he was parked on the edge of the crease. It is just the 10th career goal for the enforcer, who is known more for his contributions with his fists.
Ramo made several terrific stops during the second period -- on Bonino and Ducks left winger Rickard Rackell, in particular -- and was rewarded when Hudler converted a Smid pass to score the go-ahead goal just 26 seconds before the second intermission.
Perreault knotted the score at the 5:32 mark of the third period, jumping on loose puck after a rebound bounced behind Ramo. Ducks defenseman Sami Vatanen collected his second assist of the night on Perreault's goal.
Cogliano's eventual game-winner was another second effort, with Ramo providing a juicy rebound after a save on defenseman Stephane Robidas. Cogliano hit the back of the net to give the Ducks the lead with just 5:19 to go.
"It was a play we've been working on, just getting to the net," Cogliano said. "We feel like we've been getting shots, but we haven't been getting dirty goals. Matty got one to tie it up, and I got one off a rebound. Those are the goals we're trying to score these days."
The Flames pulled Ramo for an extra attacker but couldn't score the equalizer.
"We know we can play with every team in the league, but it's not good enough, a good effort. We have to get results, too," Ramo said. "That's the business of hockey."
NOTES: Anaheim D Francois Beauchemin was a healthy scratch. With the Ducks already booking a playoff berth, it is likely that the 33-year-old veteran was just getting a bit of extra rest. The Ducks also were without D Mark Fistric (lower body), D Cam Fowler (knee) and D Sheldon Souray (wrist) ... Flames C Markus Granlund, RW David Jones and D Dennis Wideman are all out due to upper-body injuries ... C Mikael Backlund was honored during a pregame ceremony as the recipient of the Flames' Ralph T. Scurfield Humanitarian Award. The annual award honors a player for on- and off-ice service. ... The Ducks announced they signed RW Matt Bailey to a two-year, entry-level contract. Bailey, 22, was an undrafted free agent who just completed his senior season at the University of Alaska-Anchorage. On Tuesday, the Ducks agreed to an entry-level deal with D Josh Manson, 22. He was Anaheim's sixth-round pick in the 2011 draft, and he spent the past three campaigns at Northeastern University. His father, Dave, spent 16 seasons in the NHL. ... The Ducks are back in action Friday against the Oilers in Edmonton, while the Flames will host the New York Rangers the same night.