NEW YORK (AP) — Marian Gaborik scored the Rangers’ third power-play goal in the dying seconds of overtime, and New York snapped its season-worst, three-game regulation losing streak with a 4-3 victory over the New York Islanders on Sunday night.

With the Madison Square Garden crowd imploring the Rangers to “Shoot the puck,” Gaborik snapped a rising shot over goalie Evgeni Nabokov’s right shoulder to win it at 4:54.

Brad Richards scored twice on the power play to reach 20 goals for the ninth time, and helped set up Gaborik’s winner for the Rangers, who hold a four-point lead over Pittsburgh in the races for the Atlantic Division and Eastern Conference with 14 games remaining. Brian Boyle also scored for the Rangers, who erased three one-goal deficits.

John Tavares, Matt Moulson and defenseman Andrew MacDonald had goals for the Islanders, who absorbed their second tough loss in two days. New York led New Jersey 1-0 with 1:39 remaining Saturday, but gave up a pair of goals 14 seconds apart and lost 2-1.

The Rangers had scored only one power-play goal in their previous eight games.

They tied it the last time at 3:29 of the third period when Boyle got enough of defenseman Ryan McDonagh’s shot from the left point to deflect it past Nabokov. Boyle’s sixth goal of the season snapped a 15-game drought.

The Islanders carried a 3-2 lead into the period after a back-and-forth second in which they scored twice against Lundqvist on only seven shots.

Moulson gave the Islanders their second lead of the night at 7:44 of the second with the benefit of a fortunate bounce off the glass behind the Rangers’ net. Mark Streit shot the puck, and it appeared to deflect off the stick of Rangers forward Artem Anisimov and over the net.

It struck the glass and caromed back out in front to the left post, where Moulson was stationed. He got just enough of the puck, that eluded the stick of diving defenseman Marc Staal, and nudged it off the skate of Lundqvist and into the net for his 29th goal. The Islanders took advantage of a 4-minute, high-sticking call against Derek Stepan, who clipped P.A. Parenteau in the mouth. The Rangers, who were 13 seconds away from killing it off, protested the extra penalty because Parenteau didn’t appear to bleed.

The Rangers got that one back on Richards’ second power-play goal of the night. He took a pass from Marian Gaborik at the left point and fired a shot that got through a screen in front by teammate Brian Boyle and eluded Nabokov. The feisty Islanders goalie played a major role in setting up that goal because it was his high-sticking penalty on Mike Rupp that produced the power play.

Just over a minute later, the Rangers went back on the power play, but it was the Islanders who reaped the reward. After serving a holding penalty, MacDonald came out of the box and was sent in alone on Lundqvist with a long lead pass from Tavares. MacDonald skated in, patiently waited, and put a shot in for his fifth of the season — giving the Islanders their third lead of the game with 35.3 seconds left in the second.

The Islanders had a 3-2 lead despite being outshot 24-12 through 40 minutes. The Rangers held 13-7 edge in the second period, but were outscored 2-1.

Tavares gave the Islanders a 1-0 lead with 8:45 left in the first when a loose puck in the crease bounced in off his foot for his 28th goal. Richards answered with 1:13 to go in the period, carrying the puck from behind his own net all the way into the Islanders’ zone and snapping a shot in as Islanders defenseman Travis Hamonic screened Nabokov.

Tavares scored four goals in six games against the Rangers this season.

NOTES: Nabokov was also given a minor penalty for roughing after he punched Rangers forward Brandon Prust behind the net as the second period entered. Islanders goalies had only four total penalty minutes this season before Sunday. … D Milan Jurcina returned to the Islanders lineup, after being a healthy scratch on Saturday. He replaced Mark Eaton (back spasms). … The Rangers were without captain Ryan Callahan (bruised foot) and D Michael Del Zotto (hip). C Brandon Dubinsky (sinus injury) returned after missing two games, and Mats Zuccarello was recalled from Connecticut of the AHL.

(Copyright 2012 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)