Mangiapane and Mikael Backlund each had a goal and an assist and Trevor Lewis added an empty-net goal for the Flames, who pushed the Stars to the brink of elimination in the first round of the NHL playoffs.
Game 6 is Saturday in Dallas. Game 7, if necessary, is Sunday back in Calgary.
Calgary goaltender Jacob Markstrom made 20 saves for the win.
Jason Robertson scored the lone goal and Jake Oettinger stopped 29 shots for Dallas.
Calgary (50-21-11) topped the Pacific Division, while Dallas (46-30-6) entered the post-season via the top wild-card spot in the Western Conference.
Both teams earned splits in each other's arenas to send the series to Calgary deadlocked at 2-2.
The best-of-seven conference quarterfinal reverted to low-scoring games at the Saddledome, where Calgary won 1-0 and lost 2-0 to start the series.
Dallas won 4-2 and lost 4-1 at American Airlines Arena.
The Stars didn't allow the Flames many clean exits from their own end, or into the offensive zone, with sound positional hockey for the first 40 minutes to lead 1-0.
But the line of Mangiapane, Baklund and Blake Coleman struck in the third for a 2-1 Flames lead.
Backlund in the neutral zone fed a backhand pass to Mangiapane at the Stars' blue line. Mangiapane took three strides in and beat Oettinger's glove with a high shot at 13:20.
Calgary drew even at 6:49 of the third period when Mangiapane collected on Coleman's drive to the net.
Mangiapane circled out from behind the goal-line and centred the puck for Backlund's redirect by Oettinger.
Robertson, a team-leading 41-goal man in the regular season, scored the first goal of the game and his first NHL playoff goal at 13:21 of the second period.
Stars head coach Rick Bowness had moved the 22-year-old off the top line alongside Joe Pavelski and Roope Hintz to join Jamie Benn and Tyler Seguin.
Robertson drove in from the boards and wristed a shot that deflected off Markstrom's glove and then off defenceman Noah Hanifin into Calgary's net.
Both teams didn't score on their two power-play chances and were 2-for-19 in the series.
Flames coach Darryl Sutter deployed 11 forwards and seven defenceman for a second straight game with Michael Stone remaining in the lineup for Brett Ritchie.
Flames winger Johnny Gaudreau took a deflected puck in the side of the head at the Stars' blue line. He went to the dressing room for treatment late in the period, but was back in the game in the second period.
Bowness altered his Game 5 lineup scratching forwards Denis Gurianov and Alexander Radulov.
Jacob Peterson, 22, made his NHL playoff debut and Marian Studenic, 23, drew in for a second game in the series.
When a best-of-seven series is tied 2-2, the winner of Game 5 holds an all-time series record of 219-58, according to NHL statisticians.
When the home team wins Game 5 to take a 3-2 lead, it closes out the series 80.7 per cent of the time (138-33). When the road team does so, it wins 76.4 per cent of the series (81-25).
Notes: With 92 career playoff wins, Sutter is two back of Pat Quinn for the sixth-most among NHL coaches . . . Joe Pavelski's 166th career playoff game surpassed Brian Rafalski for fifth in NHL history among U.S.-born skaters.