Huberdeau put the Flames ahead 1-0 on a breakaway at 1:55 of the second period.
Frost tied it 1-1 at 4:15 when he tipped Sean Walker's shot off Markstrom's pads and then scored on the rebound at the right side of the net.
Weegar scored from the slot to put Calgary in front 2-1 at 9:13. It was the defenseman's ninth goal of the season, an NHL career high.
"Maybe it's puck luck or getting my shots through," Weegar said. "Obviously, playing with [Rasmus Andersson] you're going to get more time. It's great to get your career high but would have been better to get the two points."
Couturier tied it 2-2 at 16:06 with a power-play goal. Frost missed the net with a shot from the left side, but Couturier got the rebound off the end boards and banked it in off Markstrom's left arm.
"I definitely saw him kind of looking the other way and there was some room to bank it off of him, and just bounced it off of him," Couturier said. "Maybe a little lucky, but it's how it goes sometimes."
Markstrom made 22 saves on 24 shots in the second period. In seven games since returning Dec. 18 from a broken finger that sidelined him for seven games, he has a 2.03 goals-against average and .935 save percentage.
"Jacob was the reason this game was close," Huska said. "Since he's come back from his injury he's been our most consistent player for sure. Every night he's played he's given us a chance to win. There was nothing different tonight."
Konecny scored on a short-handed breakaway to make it 3-2 at 2:27 of the third. He jumped on a loose puck on the left side of the Flames' zone, took two strides and beat Markstrom past his blocker.
Konecny has 10 points (five goals, five assists) during a seven-game point streak. It was his fifth short-handed goal of the season, tying Simon Holmstrom of the New York Islanders for the NHL lead, and an NHL-best 10th short-handed goal for the Flyers.
"It's a tough loss," Markstrom said. "Three goals against, that's a few too many. Unfortunately I couldn't keep it a tie game there in the third. Tough loss for us."
NOTES: Flyers forward Cam Atkinson also returned to the lineup after being a healthy scratch Thursday. He had three shots on goal in 15:56 of ice time. ... Philadelphia forwards Nicolas Deslauriers and Bobby Brink were benched in the third period. Tortorella said it was because he wanted to go with three lines. ... Flames forward Blake Coleman had his three-game goal streak end but extended his point streak to four games (six points; three goals, three assists).