NEWARK, N.J. - The struggling Pittsburgh Penguins could have given up against the New Jersey Devils.

They trailed by a goal in the third period, and goalie Cory Schneider was stopping everything and getting bailed out by some pings off the posts.

But the Penguins hung in and pulled out a much-needed win.

Defenceman Simon Despres scored 2:21 into overtime, and the Penguins rallied to beat the Devils 2-1 on Friday night.

"The way things have been going lately, we could have just accepted this as a loss, but we all stayed with it," said Chris Kunitz, who forced overtime with a power-play goal with 3:11 left in regulation. "That was the key. We stayed with it, stayed focused, kept the pressure on."

The loss spoiled a magnificent performance by Schneider, who made 41 saves.

The winning goal came after Schneider made a close-in stop on Brandon Sutton. The Penguins kept the puck in the zone, and Despres' shot from inside the blue line beat a screened Schneider.

"I didn't get a great look at it," Schneider said. "I think he came one way and shot it back the other through a screen. It just got a piece of the post and went in. It was a nice shot."

Devils president and general manager Lou Lamoriello said Schneider's performance was one of the best he has seen by a goalie in a while.

"He gave us a chance to win, more than a chance to win," Lamoriello said. "It's a shame he didn't get the win. Certainly the team would get the win, but he deserved a better fate."

Marc-Andre Fleury made 13 saves for the Penguins, who fell behind 1-0 when Devils forward Steve Bernier scored on a wraparound 6:08 into the third period.

New Jersey failed to tie its season-best, three-game winning streak. Pittsburgh won for the second time in seven games (2-3-2).

"We talked about that, the last couple of days, that most importantly, we had to stay with it," Penguins coach Mike Johnston said. "We were playing our game. We played a good game. We didn't flinch after they scored. We did whatever it took to get the game-tying goal.

"But when (Kris) Letang's shot hit the post (with 7 minutes left), you have to wonder whether it's going to be our night."

Schneider stopped the first 37 Pittsburgh shots and seemed on the verge of his third shutout of the season when Peter Harrold took a high-sticking penalty with 3:29 left in regulation.

The Penguins needed only 18 seconds to tie it 1-1. Sidney Crosby, who had been stopped point blank earlier in the period by Schneider on a nice setup by David Perron, took a shot from the right circle that hit Schneider in the chest. Defenceman Adam Larsson couldn't clear the puck, and Kunitz fired the rebound into the net for his 15th goal.

"They kept coming," Schneider said. "You have to give Pittsburgh credit. They put a lot of pressure on and took advantage of their opportunities late. We just couldn't get that extra goal or keep them at bay long enough."

Bernier had given the Devils the lead with a goal that was aided by the leg of linesman Ryan Galloway.

Bernier's dump-in into the Penguins zone hit Galloway, allowing Bernier to retrieve the puck. He skated past defenceman Robert Bortuzzo, went behind the net, came out the other side and banked the puck into the net off Fleury's skate.

Schneider kept the Devils in the game in the opening two periods, stopping 20 shots, including a breakaway by Sutter in the first and a backhander by Crosby after a sweeping move from the corner in the second.

"We have to be way better, we can't keep relying on Schneids and the other goalies to keep us in there the whole game," Devils forward Patrik Elias said. "We're not taking charge. We're not skating well. We're just sitting back. We have to be hungrier tomorrow."

NOTES: Evgeni Malkin of the Penguins missed his fourth straight game with a lower-body injury. ... Penguins F Chris Kunitz played in his 700th NHL game. ... New Jersey's Andy Greene played in his 196th consecutive game, tying Scott Stevens for the second longest streak by a Devils defenceman. ... The Devils are 5-2-2 in their last nine games. ... The Penguins snapped a five-game losing streak in New Jersey. They have won four of their past 18 games there. ... The Devils' 14 shots were their second fewest of the season, one more than they had against Detroit on Dec. 31. ... The 14 shots allowed were a season-low by Pittsburgh, four fewer than Buffalo recorded on Nov. 1.