NEW YORK -- After a rough first period, the New York Islanders came out and played as though they had nothing to lose.

At the same time, they might have caught the New York Rangers thinking they already had the game won.

The slumping Islanders erased a two-goal deficit with three second-period goals and then held off the Rangers in a shootout to win 4-3 on Thursday night and snap a five-game losing streak.

John Tavares scored in the second-period outburst and then followed Frans Nielsen's goal in the tiebreaker to seal the much-needed victory in a place the Islanders have had little recent success.

"We found a way to handle adversity," Tavares said. "We were in their face and more physical after we went down 2-0. We talked after the first about coming out with better intensity. We really challenged ourselves.

"Quite honestly, I think you settle in and you think it's going to be an easy one because we're playing really well," Rangers coach John Tortorella said. "They score one, it gives them some life ... and then they start defending."

The Rangers got back even at 3, but Evgeni Nabokov shut the door the rest of the way for the Islanders, who broke an eight-game losing streak at Madison Square Garden. The Rangers are 12-3-3 against the Islanders, dating to a win on Dec. 17, 2009.

Nabokov stopped Marian Gaborik and Rick Nash in the shootout. The Rangers were looking for their second home win over the Islanders in a week. Instead, they had a three-game winning streak snapped.

Dan Girardi and Gaborik staked the Rangers to the lead in the first period against Nabokov, and Carl Hagelin tied it in the second. It marked the second straight game they lost a multigoal lead. New York recovered to win at Boston in a shootout on Tuesday.

"We end up with three out of four points," Tortorella said of the two games. "We had a number of guys struggle, but we got a point so we don't leave here naked. That's the way you have to look at it sometimes.

"Do we have a lot of things to improve on? Yeah, but I'm not going to run them down because I thought we had some good minutes."

Nabokov made 36 saves through overtime, and Biron had 28. Both teams had four shots in overtime.

"We got the momentum on our side," Nabokov said. "You could see it in guys' eyes. They were fired up. You have to build."

McDonald got the Islanders' rally going when Casey Cizikas found him with a pass from behind the Rangers net for a quick shot that cut the deficit to 2-1.

The Rangers had a chance to stretch their lead a few minutes later when Eric Boulton and Nielsen were called for penalties 1:27 apart, giving the Rangers' struggling power play a 5-on-3 edge for about a half-minute.

Just seconds after Nielsen left the box, the Islanders got even on Tavares' eighth goal, scored off of Biron's glove at 6:45.

The home crowd had barely absorbed the sting of the blown lead when the Islanders struck again. Boyes turned a pass from defenseman Lubomir Visnovsky into a quick shot from the right circle that made it 3-2.

"Sometimes I just need to make a save and stop the bleeding," Biron said. "I think the Tavares two-on-one might have been the one for me."

The offense was a reversal of fortune for the Islanders, who came in with one of the worst goal differentials in the NHL while playing 5-on-5. They scored four power-play goals in a home loss to Carolina on Monday and netted none at even strength.

That had Rangers fans chanting "Hen-rik, Hen-rik" toward Lundqvist, who was sitting on the bench. But Biron was perfect after the second period until the shootout.

"They were chanting that they want Hank in there. He was one of the big reasons we got a point," Tortorella said.

The Rangers bounced back with their much maligned power play. They had connected for only four goals in 44 man-advantage situations this season before Thursday, and were aided by a favorable video review.

Hagelin kicked the puck with his skate and then stood tall as he crowded Nabokov in the crease. He managed to nudge the puck into the corner of the net to tie it 3-3 at 11:14.

Capuano was irate on the Islanders bench and voiced his displeasure to both referees after the goal was confirmed by a video review.

The Rangers broke out with two goals in the first period. Girardi beat Nabokov at 3:36 for the defenseman's first goal of the season. Gaborik, on his 31st birthday, doubled the lead at 11:28.

Game notes
Rangers C Brian Boyle returned to the lineup after being a healthy scratch the previous three games. Boyle recorded only one assist and was a minus-3 in the first nine games of the season. Chris Kreider sat out. ... Nabokov has started 11 of the Islanders' first 13 games. ... Hagelin has scored four goals in three games. ... Tortorella benched star forward Brad Richards for all but one shift in the third period, then used him for two shifts in overtime. Tortorella said the effort was there, but that Richards "struggled."