NEW YORK -- Rick Nash scored a tiebreaking goal with 3:27 left in the third period, and the New York Rangers defeated the Los Angeles Kings 4-2 at Madison Square Garden on Friday.
[WATCH: All Kings vs. Rangers highlights]
Henrik Lundqvist made 33 saves for the Rangers (17-12-3), who had lost two in a row.
"The key was to work with the [defense]," Lundqvist said. "They boxed out guys really well and I tried to hold on to as many pucks as I could. If you leave a rebound, there are two or three guys at the net just waiting for it."
Marian Gaborik had a goal and an assist playing his 1,000th NHL game, and Jonathan Quick made 24 saves for the Kings (20-10-3), who have lost two straight after an eight-game winning streak.
"I thought we played well," Los Angeles coach John Stevens said. "I thought we had a good start to the game, we had good jump. Our forecheck was effective for us.
"We gave up a goal, a wrister from the point on the [penalty kill]. We gave up a goal on a poor face-off coverage in the offensive zone. Late in the game we should be in a position to get points. We played a lot better, but unforced errors ended up costing us points."
Video: LAK@NYR: Kreider gets scoring started with 100th goal
The Kings tied the game twice before Nash stole the puck in the neutral zone and scored on a partial breakaway.
"It's not a team we see very often, but there were a lot of familiar faces on there and they're a team that's playing really well," Nash said. "We knew it was going to be a challenge, and those are the games you get up for, and you want to make sure you're prepared for it as best you can. We needed contributions from a lot of guys, the whole team, tonight."
Torrey Mitchell made it 2-2 when he shot a rebound to Lundqvist's right side at 7:59 of the third period. Lundqvist made the initial save on Gaborik but wasn't in position to make a second save on Mitchell, who started the play with a cross-ice pass to Gaborik just outside the Rangers zone.
Kevin Hayes put the Rangers up 2-1 at 14:43 of the second period. Ryan McDonagh was hit by two Kings players as he made the pass to Hayes, whose wrist shot beat Quick stick side.
"It was a good test for us tonight and we played as close to a full 60 (minutes) as we have all season," McDonagh said.
Chris Kreider gave the Rangers a 1-0 lead at 10:23 of the first period, with 35 seconds left on a power play. Kevin Shattenkirk's wrist shot from the point bounced off Kings defenseman Jake Muzzin in front of the net, then hit Kreider's left leg before skipping over Quick's left leg into the net. The goal was Kreider's 100th in the NHL, 11th of the season.
Gaborik tied it 1-1 at 3:46 of the second period on a 2-on 1. The Rangers turned over the puck in the Kings end and Shattenkirk was caught out of position trying to make a change. Gaborik took the puck into the Rangers zone with Jussi Jokinen and put a snap shot through Lundqvist's five-hole.
J.T. Miller scored an empty-net goal with 54 seconds left for the 4-2 final.
Video: LAK@NYR: Gaborik goes five-hole in milestone game
Goal of the game
Hayes' goal at 14:43 of the second period.
Video: LAK@NYR: McDonagh sets up Hayes for go-ahead goal
Save of the game
Lundqvist's save on Gaborik at 14:28 of the second period.
Video: LAK@NYR: Lundqvist stops Doughty, Gaborik in 2nd
Highlight of the game
Nash's goal at 16:33 of the third period.
Video: LAK@NYR: Nash scores great goal off turnover
They said it
"We were pretty solid defensively, we just had a few breakdowns, had odd-man rushes they happened to score on them. Quick did make some big saves for us too, we had a lot of shots and a lot of opportunities, we just couldn't find the net. We had a bunch that got tipped in front that hit Lundqvist. It's a frustrating loss, like I said, but it's over with." -- Kings defenseman Drew Doughty
"You have moments where we create good chances and have good energy and then they turn it up. They're a heavy team. They're good at it. When they get going, they use the [defensemen] a lot, they crash the net hard. It's a pretty physical game for me to play and try to find pucks. It's a battle. It was a fun game for me to play." -- Rangers goalie Henrik Lundqvist
Need to know
Gaborik has played 209 games for the Kings; he played 255 for the Rangers from 2009-13. … New York is 11-1-1 in its past 13 home games.
Kings: At the New York Islanders on Saturday (7 p.m. ET; MSG+, FS-W, NHL.TV)
Rangers: At the Boston Bruins on Saturday (5 p.m. ET; NESN, MSG+ 2)
Video: Nash, Rangers take down Kings, 4-2