Mrazek, whom the Red Wings traded to Philadelphia last month, had a forgettable homecoming, as the Red Wings drove him out of the net in the second period. The Flyers did rally, but the Red Wings ended up winning 5-4 in a shootout.
The Red Wings had a 1-0 edge in the shootout, with Frans Nielsen scoring the goal and Jimmy Howard stopping all three Flyers shooters.
The win ended a 10-game winless streak for the Red Wings, who hadn't won since Feb. 25.
Dylan Larkin scored his second goal of the game, and 11th of the season, quickly firing a loose puck past Flyers goalie Alex Lyon (who replaced Mrazek) at 14 minutes, 6 seconds of the third period, giving the Red Wings a brief 4-3 lead.
But the Flyers tied it at 4 just 28 seconds later on Travis Konecny's 20th goal, driving to the net, and tapping in a loose puck.
Matt Read and Shayne Gostisbehere (power play) scored 1:54 apart midway in the third period, tying the score at 3.
Larkin, Luke Glendening (short-handed) and Evgeny Svechnikov scored within a 3:49 second span in the second period, ending Mrazek's night.
Mrazek (16 saves) allowed three goals on six shots in the second period as the Red Wings pulled away, with Svechnikov's first NHL goal driving Mrazek to the showers.
But before Mrazek left the ice, he beelined to the bench and gave an earful to Flyers coach Dave Hakstol before heading to the locker room.
The Red Wings dealt Mrazek for two conditional draft picks — the 2018 pick will be a third-rounder if Philadelphia makes the playoffs, which they likely will — but Mrazek has been as inconsistent for the Flyers as he was in Detroit.
Even Tuesday's game was a classic Mrazek performance — a fine first period, stopping all 13 shots, including good stops on a Tyler Bertuzzi backhand in the slot and Svechnikov's wrap-around attempt, then the sloppy second period.
Red Wings players talked after the morning skate about how strange it would be facing Mrazek in a game.
"A little bit different for sure," defenseman Danny DeKeyser said. "He's friends with a lot of guys in this room. He was another guy that it was tough to see go (traded)."
Mrazek was close friends with Tomas Tatar (since traded to Vegas) and Martin Frk on the Red Wings.
"He did text with me (Monday) and I did chat with him a little bit," Frk said. "He just told me how he's doing, he asked how we were doing as well.
"It's like right now we're friends but when we get to the game, it'll be just like playing against another other guy."
Larkin opened the scoring at the 6:08 mark of the second period.
After Howard stopped a shot from the point the puck came to Helm, who fed Larkin into a 2-on-1 break. Larkin used Helm as a decoy and beat Mrazek with a shot from the top of the dot off the rush.
The goal was Larkin's 10th of the season and ended a 17-game goal-scoring drought dating to Feb. 13.
Glendening quickly extended the lead to 2-0 with the short-handed goal.
Trevor Daley fed Glendening on what amounted to a 2-on-2 rush, and Glendening placed a shot just over Mrazek's left shoulder from the top of the circle, for a 2-0 lead.
The goal was Glendening's ninth and was quickly answered by the Flyers, still on the power play.
Sean Couturier scored his 30th goal at 8:54, tapping in a rebound of Claude Giroux's shot from the spot, cutting the Red Wings lead to 2-1.
But Svechnikov quickly restored the two-goal Red Wings lead and drove Mrazek out of the game.
Frk and Svechnikov both had clear shots in the slot, with Mrazek scrambling and little defense in front of him.
Svechnikov waited a split second to get set and fired into a nearly open net with Mrazek attempting to regain his balance.