Jim Jackson, Ed Beers and Lanny McDonald scored third-period goals to enable the hosts to win.
Calgary hasn't lost in five games and is six points ahead of the third-place Winnipeg Jets in the NHL's Smythe Division.
A bruised ankle put Buffalo's Craig Ramsey out of the game, ending his consecutive games played with one club at 776, an NHL record. The mark is the second longest consecutive game streak in NHL history.
Jackson took a pass from Kent Nilsson in front of the Sabres net and drove the puck past falling defenseman Bill Hajt to tie the score 2-2 just 17 seconds into the final period.
Beers put the Flames into the lead with a wrist shot at 13:09 and McDonald's empty net goal with 20 seconds remaining put the game away. It was McDonald's 48th of the season, giving him a two-goal edge over Wayne Gretzky as the league's leading goal scorer.
Buffalo opened the scoring after just 43 seconds in the first period when Andre Savard deflected Larry Playfair's shot from the blueline. Calgary retaliated with a goal just 13 seconds later on a 10-foot slap shot from center Kent Nilsson.
Buffalo scored the only goal of the second period when rookie Geordie Robertson, playing in his first NHL game, was uncovered at the side of the net and batted the puck in at 5:35.