The Flyers scored three goals in the third period, twice rallying to tie the game, but Frans Nielsen scored the shootout's only goal, beating Alex Lyon in the first round, to lift the Red Wings to the win.
[WATCH: All Flyers vs. Red Wings highlights]
"We scratched and clawed back to get a huge point, but we also left a crucial point on the table," Philadelphia coach Dave Hakstol said. "We can't wait until the third period to start playing."
The Flyers (37-25-12) dropped to fourth place in the Metropolitan, one point behind the second-place Pittsburgh Penguins and third-place Columbus Blue Jackets, who won 5-3 at the New York Rangers. Philadelphia holds the first wild card into the Stanley Cup Playoffs from the Eastern Conference.
Video: PHI@DET: Nielsen puts Red Wings ahead in shootout
Petr Mrazek allowed three goals on 19 shots in his first game in Detroit since being traded by the Red Wings to the Flyers on Feb. 19 and was relieved by Lyon (11 saves) midway through the second period.
Dylan Larkin had two goals and an assist, and Jimmy Howard made 27 saves to help the Red Wings end a 10-game losing streak (0-9-1) with their first win since Feb. 25.
"We were getting pretty desperate because it has been a while since we've won a game," said Larkin, who had his third two-goal game in the NHL, first since Oct. 25, 2016. "It feels great to finally get two points."
Detroit (27-35-11) is 17 points behind the New Jersey Devils for the second Eastern wild card.
The Flyers trailed 3-1 entering the third period but tied the game with two goals in 1:54.
"We knew they had lost 10 in a row, so they were going to be fragile," defenseman Shayne Gostisbehere said. "If we could get one, we thought we could get back into it."
Matt Read scored his first goal of the season at 7:46 of the third period to bring Philadelphia to within 3-2, and Gostisbehere tied it 3-3 with a power-play goal at 9:40.
Larkin scored his second of the game at 14:06 to put Detroit ahead 4-3, but Travis Konecny tied it 4-4 at 14:34.
Video: PHI@DET: Larkin beats Mrazek on an odd-man rush
"You could see we didn't have a lot of confidence in the third, but we stayed with it and battled," Red Wings coach Jeff Blashill said. "We got it to overtime and ended up winning it."
Larkin gave the Red Wings a 1-0 lead at 6:08 of the second period, beating Mrazek with a wrist shot from the right face-off dot.
"It felt pretty good to score on Petr," Larkin said. "I was getting worried in the first period, because he looked so comfortable out there."
Luke Glendening made it 2-0 with a shorthanded goal at 7:59, beating Mrazek to the short side with a wrist shot over his glove from the right face-off circle.
"I played that all wrong," Mrazek said. "I know he will shoot from anywhere when he's killing, so he didn't surprise me. I just didn't get it."
Sean Couturier scored his 30th goal, on the power play, at 8:53 to make it 2-1 after Claude Giroux hit the post.
Evgeny Svechnikov scored his first NHL goal at 9:57 to make it 3-1 and chase Mrazek.
"I got a great bounce," he said. "I tried to feed [Martin] Frk and they blocked it, and it bounced right on my tape. I shot it and it went in. That was the best feeling."
Video: PHI@DET: Larkin nets Mantha's feed for second goal
Goal of the game
Glendening's goal at 7:59 of the second period.
Video: PHI@DET: Glendening doubles Red Wings' lead with SHG
Save of the game
Howard stopping Giroux at 3:23 of overtime.
Video: PHI@DET: Howard makes pad save on Giroux in OT
Highlight of the game
Svechnikov's goal at 9:57 of the second period.
Video: PHI@DET: Svechnikov buries loose puck for first goal
They said it
"Our second period was awful. We ended up getting a point, which was good, but we can't show up in the third period and expect to be able to salvage the game." -- Flyers defenseman Shayne Gostisbehere
Video: PHI@DET: Gostisbehere wires home wrister for PPG
"We were frustrated after the third period, because it just kind of snowballed on us. I'm glad we found a way to get a win." -- Red Wings goalie Jimmy Howard
Video: PHI@DET: Howard extends pad to deny Giroux late
"Dylan's played really well and not been rewarded with points, so it was good to see him get a couple goals. He's done a real good job of developing a 200-foot game, and that's why he's going to be a great player in this league." -- Red Wings coach Jeff Blashill on forward Dylan Larkin
Need to know
Giroux's assist on Couturier's goal was his 660th NHL point, moving him past Eric Lindros for fifth in Flyers history. … Mrazek played his first 166 NHL games for the Red Wings, going 72-58-20 with a 2.60 goals-against average and .912 save percentage. … Nielsen extended his NHL records for shootout goals (48) and deciding goals (22), and Howard improved to 6-1 in his past seven shootouts.
Flyers: Host the New York Rangers on Thursday (7 p.m. ET; NCBSP, MSG, NHL.TV)
Red Wings: Host the Washington Capitals on Thursday (7:30 p.m. ET; NBCSN, NHL.TV)
Video: Larkin, Nielsen lead Red Wings to 5-4 shootout win