After seeing a 5-2 third period lead get cut to 5-4 and with the Blues pressing for the equalizer, Frolik broke in alone and fired a shot under the crossbar at 16:49.
The 28-year-old Czech completed his second career hat trick with an empty netter with 35 seconds remaining, sending hats flying onto the ice at the raucous Scotiabank Saddledome.
The Blues lost a chance to move ahead of Dallas into top spot in the Central Division. They remain tied in points with Stars, who now hold a game in hand.
Tied 2-2 after the first, Monahan gave Calgary the lead at 5:13 when he wristed a perfect shot over the shoulder of Jake Allen.
After Mark Giordano's power-play goal at 11:03 made it 4-2 and led to Allen getting pulled, Monahan made it a three-goal cushion at 13:37 beating Anders Nilsson through the legs on a breakaway.
Not going down without a fight, Shattenkirk made it 5-3, taking just 10 seconds to convert an early third-period power play.
St. Louis got to within one on Stastny's breakaway goal at 13:31.
Jaden Schwartz nearly tied it, putting a shot off the goal post on the last power play just seconds before Folik put the game away.
With 31 stops, Joni Ortio improved to 3-7-3. Nilsson, who had 12 saves in relief of Allen, ended up with the loss to fall to 10-13-2. Allen had 13 stops.
Calgary struck first at 10:24 on a flukey goal. Allen went behind his net to stop a dump-in only for the puck to strike the stanchion in the corner and bounce wickedly into the slot where Colborne buried his 13th into an open net.
The lead lasted only nine seconds with Upshall beating Ortio over the shoulder from a sharp angle.
Notes: Calgary's T.J. Brodie (upper body) and Sam Bennett (upper body) both missed their second game... Flames Matt Stajan hasn't scored in 28 games... St. Louis had won the previous six meetings between the two teams... Gaudreau increases his NHL-leading home point total to 51 (23 goals, 28 assists). He's five up on Chicago's Patrick Kane.