Daniel Alfredsson (11) is congratulated by teammate Tomas Tatar on his game-winning goal in overtime against the Pittsburgh Penguins.

DETROIT – The undermanned Detroit Red Wings knew they would be under siege at times Thursday at Joe Louis Arena against the deep, star-studded Pittsburgh Penguins in a matchup that had the potential to turn ugly.

A young team missing a host of injured players, including Pavel Datsyuk and Henrik Zetterberg, was deflated at times, but never defeated.

The Red Wings showed tremendous resiliency and pulled out an exhilarating 5-4 victory when Daniel Alfredsson scored his second goal of the game with a split-second remaining in overtime.

Detroit (32-24-13, 77 points) earned a crucial two points in its desperate chase for a playoff spot.

It was a night of huge momentum shifts. The Red Wings started strong but lost a two-goal lead when the Penguins scored three times in a span of 2:41 late in the second period.

Detroit then scored twice in 2:18 midway through the third to regain the lead, only to see Pittsburgh tie it with 5:43 remaining in regulation following a defensive breakdown.

Then the Red Wings needed to kill a five-minute major penalty on David Legwand for butt-ending Evgeni Malkin with 3:46 to play in regulation.

“I don’t know if I want to call it gutsy, but I thought we showed a lot of character,” defenseman Niklas Kronwall said. “I thought we had some great chances to go up 3-0, instead for whatever reason we kind of spoiled it with a few goals and all the sudden they’re up 3-2. We didn’t give up; we kept sticking with it and found a way to battle back. You’re down four-on-five, Howie came up huge for us a few times and we found a way.”

Jimmy Howard made 39 saves.

“I thought we did lots of good things; obviously, we did some things that weren't great either,” Red Wings coach Mike Babcock said. “We made some mistakes, they made mistakes, but we stayed with it and found a way to win a game. That was a big win for us. I thought our guys battled real hard.”

Alfredsson notched his 16th goal of the season – needless to say his most important as a Red Wing – off a three-on-one rush. Marc-Andre Fleury made the save, but the rebound bounced in off defenseman Rob Scuderi.

“I didn’t know there was just a few seconds left, but I know I didn’t hear the horn go off before the puck went in so I thought it would be good,” Alfredsson said. “Big break for us, rebound goes off their D and in so we’ll gladly take it.”

Three goals went in off Penguins defensemen.

“You do a lot of good things, you get lucky,” Alfredsson said. “We’ve been on the other side of those a few times, this time it feels great to be able to pull out a big win tonight against a good team.”

As for the call on Legwand, who was tossed from the game, Babcock said, “When it happened, to be honest with you, because they had been all over him, I thought that it was weak. But when I watched it on video, he just made the call.”

After Alfredsson (7:21 of the first) and Gustav Nyquist (his team-leading 20th goal at 4:35 of the second) gave the Red Wings a 2-0 lead, the Penguins stormed back with a goal from Lee Stempniak at 15:17 and two from Malkin (15:42 and 17:58 on a five-on-three power play).

Babcock said he told the team it was still in a good spot after two.

“Let’s not make it worse than it was, let’s just play,” Babcock said. “We really felt we had an opportunity. Our guys played hard in the third.”

Tomas Tatar tied it at 9:59 and Todd Bertuzzi gave Detroit a 4-3 lead at 12:17.

Craig Adams tied it with 5:43 remaining in the third period, setting the stage for some late heroics.

“On paper, they’re a more skilled team than us right now but it’s a team game and it was great to see that we found a way to win tonight,” Nyquist said.

Said Penguins captain Sidney Crosby: “We had more than enough opportunities to win that game. Sometimes you pay for your mistakes and we didn't get away with some things.”

The term “playoff atmosphere” is overused in regular season games, but Kronwall said this night had that feel.

“Yeah, definitely, crowd was really into it. It was a fun game to play,” Kronwall said. “We’d like to not give up that many goals. Usually it’s tough to win when you let four in, but tonight we found a way to win and that’s all that matters.”