Both teams scored twice in the third in rapid succession before Jack Eichel - who moments earlier hit a post in OT - scored in extra time for a 4-3 victory.
Johnny Gaudreau, Matthew Tkachuk and Noah Hanifin scored for Calgary, while David Rittich made 19 saves.
Evan Rodrigues, Rasmus Dahlin and Jake McCabe had the other Buffalo goals, with Linus Ullmark making a handful of stellar stops as part of a 30-save performance.
The two clubs met earlier this year back on Oct. 30 in Buffalo, with Gaudreau scoring the winner in another OT contest.
"They're a good team," said Mark Giordano. "They're a playoff team in the East and they play well, they play fast. We had our looks, but we know we can be better. I think we can clean up a few areas. We gave them a few breakaways there that we don't usually do. At the end it was just... 3-on-3, if you get a chance. We had a 3-on-1 before they came back the other way and scored.
Eichel came close to putting his team up 1-0 before some fans had even settled into their seats to start the game, getting a great chance 30 seconds in with a wrist-shot that beat Rittich but clanged off the far post.
A few minutes later, Derek Ryan - playing in his 200th NHL game - nearly made it to the rebound of an Elias Lindholm shot that was sitting in the crease with an open net behind it, but Zach Bogosian beat him there and cleared it out of harm's way.
The Flames - who came into the tilt with a league-leading 11 shorthanded goals - had two partial breakaway chances while Mikael Backlund was in the bin for hooking, both Garnet Hathaway and Mark Jankowski - who is tied for tops in the NHL with four shorties already this campaign - stopped on backhand attempts.
With time winding down in the first period and the Flames on a powerplay courtesy of a Jason Pominville trip on Tkachhuk, Lindholm stepped into a slapshot from the right faceoff circle that Ullmark kicked out with the puck bouncing off Bogosian's skate and right onto the stick of Gaudreau, who snapped home his team-leading 28th tally of the season with just 0.5 seconds left to play.
The goal extended Johnny Hockey's current point streak to nine games (9-10=19).