Derek Smith tied it early in the third period and helped set up Mikael Backlund's power-play winner with 9:35 left in the Flames' 5-3 victory on Saturday.
Jarome Iginla assisted on both goals to finish the game with three assists.
Olli Jokinen scored twice for Calgary, the first on a power play early in the first and the second an empty-netter with 32 seconds left. Rene Bourque also scored in the first for Calgary, down 2-0 after Lennart Petrell and Sam Gagner scored for Edmonton in the first three minutes.
"It could have gotten away from us there," Iginla said. "They were really rolling. I thought we were going to get a beating. Fortunately, we took a timeout and calmed down and came right back with a goal on the power play and got our feet back into us and back into it."
Ryan Nugent-Hopkins gave Edmonton a 3-2 lead at 5:27 of the third, but Smith tied it at 6:11, and Backlund added his power-play goal.
The Flames improved to 11-12-2. They have won three of their last four games and seven in a row against Edmonton.
"It wasn't the start we wanted to have," Jokinen said. "We needed to get back to our game and play good defense against this team. They are probably the most skilled team in the National Hockey League. They have a lot of offense. If you try to play their style, you are going to lose 10-0."
The Oilers have lost four of five to drop to 13-11-3.
"We got a two-goal lead and thought it was going to be easy, but it's never easy," Gagner said. "We've got to find a way to rectify that."
Oilers head coach Tom Renney agreed his team has some work to do.
"Calgary found a way to fight their way back into it," he said. "We've got to continue to compete, and harder than we have been lately, because it hasn't been enough."
On the tying goal, Iginla fed it forward to Smith, who joined the rush from the defense and picked the top corner of the Edmonton goal.
The Flames then took their first lead when Backlund gave Iginla's power-play shot a nudge on its way into the net for his first goal of the season.
It was the second of six meetings between the provincial rivals. The Flames won the first 2-1 in Calgary. ... Ryan O'Marra remained in the lineup for the Oilers with Anton Lander out with a hand infection. Edmonton also was without forwards Taylor Hall (shoulder) and Ben Eager (back) and defenseman Corey Potter (ankle).