DETROIT -- Devan Dubnyk was impenetrable for nearly 60 minutes on Friday.

But the Detroit Red Wings stuck with it. They kept firing shots at the young Edmonton goaltender, kept retrieving the puck and kept coming at the Oilers in waves in the second and third periods.

Their perseverance paid off in the end. Nicklas Lidstrom scored with 24.8 seconds remaining in regulation to tie it, and Pavel Datsyuk scored with 43 seconds to play in overtime to lift the Red Wings past the Oilers 2-1 at Joe Louis Arena.

It was some much-needed relief for Detroit, which snapped a season-long four-game winless streak (0-2-2) and ended its three-game home losing skid.

"It’s kind of like I expected," Red Wings coach Mike Babcock said. "Anytime you’re in the tank like we’ve been, it’s always ugly when you come out of it."

The Oilers have the worst record in the NHL, 34 points behind the Red Wings, and rank last or to close to the bottom of the league in all major statistical categories (offense, defense, power play, penalty killing). And Edmonton was missing its three leading scorers — Taylor Hall, Sam Gagner and Alex Hemsky — due to injuries.

But Dubnyk, their 6-foot-6 backup goalie, nearly stole the game.

"The kid’s huge. He looks like he’s 6-6, there’s no net," Babcock said. "In order to score, you’re going to have to get some second chances. We were able to persevere. I think it’s important for us to understand we won tonight because we continued to work and continued to do things right and we were rewarded."

The Red Wings had 44 shots, 38 after a sluggish first period. Datsyuk scored the winner on a wrist shot from the high slot through traffic.

"First (Niklas) Kronwall did a good job; he just kept everybody on one side and gave it to me and then (Johan Franzen) did a big screen," Datsyuk said. "I just needed to shoot fast."

Detroit went 0-for-6 on the power play and missed an excellent opportunity in the third period, when it had a five-on-three advantage for 1:26. The Red Wings later killed a double-minor high-sticking penalty on Drew Miller. Then, they pulled Jimmy Howard for the extra skater in the final minute, leading to Lidstrom’s goal.

"When I got the puck, they had a guy come out in the shooting lane and I couldn’t get it on net, so I tried to shoot it wide for a tip and it got deflected by one of their players and luckily it went in," Lidstrom said. "I think the goalie reacted to the shot going wide and he couldn’t get back into position."

Edmonton opened the scoring at 6:40 of the first period on a harmless-looking play, as Ryan Jones fired a wrist shot from the left flank that slipped under Howard’s outstretched right pad. But Howard shut the door the rest of the way, making 26 saves.

"I just stood back there and wanted to give the guys a chance," Howard said. "We deserved it. We played an excellent game. The guys did a great job firing pucks at the net."

Detroit thought it netted the equalizer with 21.1 seconds remaining in the second period on a shot by Lidstrom. But after a lengthy video, league officials in Toronto ruled that Todd Bertuzzi directed the puck into the net with his glove and the goal was disallowed.

"That goal probably shouldn’t have counted and it didn’t," Babcock said.

It didn’t matter in the end.

"In the first period we weren’t engaged enough," Babcock said. "They made it hard, their 1-3-1, stacked it up at the blue line and the red line until we started putting the puck in and getting it back in the second period."

Lidstrom said it was a relief.

"It means a lot, especially how hard we worked to get the win," Lidstrom said. "We said in here we can’t get frustrated, you have to stick with it and shoot the puck and get chances that way."