Roope Hintz, Michael Raffl, Miro Heiskanen and Tyler Seguin scored for the Stars, while Jake Oettinger posted 36 saves.
Michael Stone and Mikael Backlund replied for the visitors, with Jacob Markstrom turning in a series-high 36 stops in the Calgary crease - including 27 in the final two periods, when he was easily the best player on the ice and the reason the Flames were in it to the end.
Once again, the Flames went with 11 forwards and seven defenceman - and Stone did not disappoint in that 'spare' role. The 31-year-old finished with two points (1G, 1A) and three shots on goal in 14:34 of ice time.
With their season on the line, the Stars came out with an early push and tested Markstrom with three of the game's first four shots. But the Flames quickly replied, and it was the top line going to work. Johnny Gaudreau and Matthew Tkachuk were absolutely buzzing, connecting on a nifty play through the slot that eventually rang off the post.
While the fiery sequence didn't result in a goal, they did draw the game's first penalty when Chris Tanev was tripped on a scoring chance off the right circle.
On the ensuing PP, Stone had the best chance as he unleashed a wrister from the right circle, but Oettinger came up with a massive blocker save to keep the game scoreless.
The Stars took a 1-0 lead with 5:08 to play in the period, when Hintz took a drop pass from Joe Pavelski down the wing and rifled a shot through the wickets of Markstrom. The goal came only seconds after Gaudreau was robbed, point-blank by Oettinger, after Tkachuk swung a no-look pass into the slot from his office behind the net.
Shots on goal favoured the Flames 18-10 after one.
Raffl gave the Stars a 2-0 lead at 6:04 of the second. Joel Kiviranta made a great play to split the D and break in alone, but Markstrom came up with a strong, left-pad save. However, with the puck sitting precariously in the blue paint and with Markstrom splayed across the crease, Raffl drove hard to the net and plunged home the rebound.
You could sense the Stars and their raucous home crowd had taken over the game.
Which is why, what happened next, was so massive.
Gaudreau suddenly found himself on a 2-on-1 with Stone - and with one quick pass through the feet of the defender, Stone hammered a one-timer from his natural side into the back of the cage.
The goal came at 8:09 and Tkachuk picked up the other helper.
The Flames then evened things up with a powerplay goal exactly 12 minutes into the stanza. Stone put the puck on a tee for Backlund, who uncorked a clapper from the right circle that pinballed off Miro Heiskanen and past Oettinger.
The Flames were due for a break like that.
Unfortunately for the visitors, the Stars went back in front before the period was out. With 2:28 to play, Heiskanen moved in from the right point and filtered a shot through traffic, beating Markstrom clean over the glove to make it a 3-2 game.
The Stars had the better of the play in the middle frame, outshooting the Flames 17-9, giving both teams a two-period total of 27.
The Flames pressed early in the third and nearly tied it when an Erik Gudbranson shot was tipped off the post, but the Stars went to the powerplay seven minutes into the frame, looking to extend the lead.
But they didn't.
And it was all thanks to Sweden's greatest export - the Vezina finalist himself in Markstrom.
The netminder used all 6-foot-6 of his reach to make one of the most miraculous pad saves you'll ever see, after Seguin got a backdoor pass and had an open net to shoot for.
The Flames were unable to mount a push in the final few minutes and Seguin iced it with an empty-netter at 19:18.