Matthew Tkachuk had a goal and an assist for Calgary, which trailed 3-1 early in the third period. Sam Bennett and Sean Monahan also scored.
It was Mangiapane's first career hat trick.
''Obviously it was nice to get the first one out of the way,'' the 23-year-old left winger said. ''Confidence is big in this league. Every game you play, every move you make, you're growing as a player.''
Mangiapane's 12th goal got the Flames within one 4:46 into the third. After Bennett tied it 19 seconds later, Mangiapane set up Tkachuk at 12:59. Tkachuk's initial shot was stopped, but he fired in the rebound from a scramble.
Mangiapane completed his hat trick with an empty-netter, taking a pass from Johnny Gaudreau.
''There was no way (Gaudreau) was going to shoot that puck. He was going to do whatever he had to do to make a pass,'' Flames interim coach Geoff Ward said. ''Guys feel good for a guy like that. He comes in, he's a great team player, he's well-liked in the room. He works extremely hard. He's earned the respect of the veteran players. so the guys were really pulling for him to get it and it's nice to see him get it.''
Adam Henrique, Jakob Silfverberg, Nicolas Deslauriers and Devin Shore scored for Anaheim. Ryan Miller made 37 saves.
Cam Talbot made 26 stops for Calgary.
Leading 2-1 after 20 minutes, Anaheim made it a two-goal cushion at 3:05 when Deslauriers' shot from the sideboards caromed sharply off the skate of Flames defenseman Michael Stone and went over Talbot's shoulder.
But the Flames responded big time with five straight goals.
''I wish I could stand out here and say that we quit playing, but goals two, three, four and five, we had the puck on our stick, all under full control,'' Ducks coach Dallas Eakins said. ''Goals two, four and five are just simple breakout plays that our guys make with their eyes closed and for some reason we wanted to complicate it by either coming up the strong side or going to the front of the net.''
The Ducks opened the scoring 5:53 into the second, taking advantage of a turnover by Bennett. Nick Ritchie corralled the loose puck and sprung Henrique on a breakway. He just managed to squeeze a shot through the pads of Talbot.
Mangiapane tied it up less than a minute later, burying Noah Hanifin's rebound, but another costly mistake helped the Ducks move ahead again at 10:37.
Hanifin mishandled the puck in his own end, allowing Silfverberg to stroll in alone on Talbot.
''It was more us giving it to them than them taking it to us,'' Anaheim defenseman Hampus Lindholm said. ''We, as a team, need to find ways to win those games, especially a road game, 3-1 in the third, that's a very good position to be in.''
NOTES: Monahan's 190th career goal moves him into eighth on the Flames list, tied with Joe Mullen. ... The Flames placed C Derek Ryan (flu) on injured reserve and called up C Glenn Gawdin, 22, from the minors. ... Ducks D Korbinian Holzer played in his 200th career game.
Ducks: Host the Florida Panthers on Wednesday night.
Flames: Host the Boston Bruins on Friday night.
Copyright 2020 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.