Blake Coleman and Mikael Backlund each had a goal and an assist, and Christopher Tanev also scored for Calgary. Johnny Gaudreau got his seventh assist of the season, and Jacob Markstrom stopped 28 shots to improve to 7-2-1 in his career against New York.
Dryden Hunt scored for the Rangers, who had won four straight - all on the road. Igor Shesterkin, making his fifth start, finished with 32 saves.
Trailing 2-0 after 40 minutes, the Rangers got on the scoreboard early in the third period. Markstrom stopped the initial shot by Jacob Trouba, but Hunt corralled a rebound in front and put it past the goalie for his first of the season at 5:25.
Coleman restored Calgary's two-goal lead less than three minutes later as he backhanded the rebound of his own shot past Shesterkin for his second.
Backlund made it 4-1 with 8 1/2 minutes left as he scored into the top left corner from the right circle for his first.
''It was a great response,'' Mangiapane said. ''You never want to give up goals, especially late there. It was a good response by our guys to change the momentum. A big goal by Coles and followed up by Backs. Good two key goals there for us to lock it down there.''
Mangiapane got his second of the night, scoring on a rebound on the power play from the right side with just over five seconds remaining. It was his fifth of the season and 10th in his last nine games, dating to last season.
''He's really good around the net. He has great work ethic. He has good hands,'' Flames coach Darryl Sutter said.
Leading 1-0 after one period, the Flames doubled their lead early in the second. Mangiapane intercepted a pass by Patrik Nemeth from behind the Rangers net and beat Shesterkin from the right side at 2:09.
Mika Zibanejad had a chance to get the Rangers on the scoreboard after a Flames turnover as he skated up the ice with Alexis Lafreniere, but was denied by Markstorm with about 6 1/2 minutes left in the middle period. Shesterkin made a nice glove stop on a slap shot by Tyler Pitlick about 40 seconds later.
Markstrom stopped a wraparound try by Trouba with just more than two minutes to go, and then denied his backhand follow.
Calgary outshot New York 15-7 in the first period. Shesterkin's best save of the period came on an attempt by Sean Monahan in front with 3:15 remaining after a giveaway by the goalie.
''We just made so many bad turnovers the first period, trying to make cute plays instead of strong plays up the boards that really cost us, even though it was only 1-0,'' Rangers coach Gerard Gallant said. ''We made a lot of turnovers and Shesty had to be unbelievable that first period. That really cost us the hockey game even though we got back in the third period, made it to 2-1.''
Tanev got the Flames on the scoreboard on a rush with 1:10 left in the opening period as he took a pass from Gaudreau and beat Shesterkin from the right circle on the glove side for his first of the season. Elias Lindholm got his first assist and seventh point on the play.
''It was a good first period for us,'' Sutter said. ''The Rangers were coming off a road trip. They probably weren't as sharp as they wanted to be early.''
The Rangers were down two players for much of the first. Rugged forward Ryan Reaves went to the dressing room early in the period after an apparent injury to his left leg, and defenseman Ryan Lindgren joined him by the midpoint after blocking a shot with his foot. Lindgren was back on the bench late in the period, and returned to the ice in the second. Reaves was also on the bench at the start of the second, but did not play again.
The Rangers went 0 for 2 on the power play and are 3 for 26 this season. ... The Flames were 1 for 2 with the man advantage, improving to 3 for 14.
Ryan Strome returned to the Rangers' lineup after missing the four-game road trip due to COVID-19 protocols. He started on a line with Artemi Panarin and Barclay Goodrow. Morgan Barron was sent to Hartford of the AHL to make room for Strome. Injured forward Kappo Kakko is still out and Gallant said Kakko could return Friday. Julian Gauthier was also back in the lineup, and Greg McKegg was scratched.
With the exception of Markstrom, the Flames used the same lineup as Saturday against Washington.
Flames: At New Jersey on Tuesday night.
Rangers: Host Columbus on Friday night.
Follow Vin Cherwoo at http://www.twitter.com/VinCherwooAP
More AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.