NEW YORK -- Chris Kreider scored a power-play goal with 4:57 remaining in the third period, and the New York Rangers came back to defeat the New Jersey Devils 4-3 at Madison Square Garden on Wednesday.

Kreider gave New York a 4-3 lead at 15:03 with a net-front deflection of Adam Fox's shot after Artemi Panarin carried the puck into the zone and dropped it for him.

Kaapo Kakko scored the tying goal early in the third, and Panarin and Alexis Lafreniere each had a goal and an assist for the Rangers (51-21-4), who have won eight of their past 10. Fox had two assists, and Igor Shesterkin made 17 saves.

New York extended its lead in the Metropolitan Division to five points over the Carolina Hurricanes. The Rangers also lead the Presidents’ Trophy race by one point over the Dallas Stars with 106 points and six games remaining. Dallas defeated the Edmonton Oilers 5-0 on Wednesday for its eighth straight win.

"We went down 3-2 and you now have to dig in in the last 20 minutes and make sure you win that game," Rangers coach Peter Laviolette said. "I really liked the third, liked the way we responded to that."

NJD@NYR: Kreider redirects Fox's shot into the net, giving the Rangers the lead

Nico Hischier scored, Jesper Bratt had two assists, and Kaapo Kahkonen made 37 saves for the Devils (36-36-4), who have lost three games in a row and four of their past six. New Jersey was coming off a 6-3 loss to the Pittsburgh Penguins on Tuesday.

The Devils remained six points behind the Washington Capitals for the second wild card into the Stanley Cup Playoffs from the Eastern Conference with six games left.

"Especially when you have four defensemen, you've got guys who haven't killed penalties before trying to kill penalties, we played last night, guys were tired," New Jersey interim coach Travis Green said. "It was a good effort by our group."

The game started with a line brawl off the opening face-off resulting in all 10 skaters getting fighting majors and eight getting game misconducts, leaving the teams with 14 skaters per side.

From the Rangers, Jacob Trouba, K'Andre Miller, Barclay Goodrow and Matt Rempe all received game misconducts. Kurtis MacDermid, Chris Tierney, Kevin Bahl and John Marino were the disqualified Devils.

Rangers forward Jimmy Vesey and Devils forward Curtis Lazar were the two who fought but stayed in the game. The officials determined they had the original altercation and the others followed. It's an automatic game misconduct to fight after the original altercation.

"We're not trying to make a mockery out there, it's just guys having each other's backs," Fox said. "I think everyone did a great job of stepping up for each other."

MacDermid said he and Rempe "both figured we were going to go" based on recent history between them and New Jersey’s discontent with Rempe's hits on their players in prior games.

But MacDermid said the line brawl was unexpected.

"I had no idea that was going to happen," he said. "It was just kind of a spur of the moment thing."

Laviolette and Green, who were yelling at each other from across the benches after it happened, also both said they didn't know the line brawl was going to happen.

"Our guys were reacting to what was happening on the ice," Laviolette said. "I thought they did a fantastic job, all five of them."

The Rangers seemed to have a better reaction to it in the first period.

NJD@NYR: Panarin snipes a snap shot between the pipes

Panarin gave them a 1-0 lead at 9:22, scoring his 45th goal of the season with a one-timer from the left face-off circle off a pass from Lafreniere.

The Devils issued a coach's challenge for offside, but it was determined following video review that Fox played the puck at the right point before it left the zone.

Lafreniere made it 2-0 at 18:03 with a goal off a rebound.

"There was a little bit of a letdown after the first period," Laviolette said. "You're up 2-0, you're back on the ice thinking it's over and they're fighting for their lives out there, New Jersey. They're scraping for points, and they proved that in the second period."

NJD@NYR: Smith, Bratt team up to tie game at 2-2 in the 2nd

Ondrej Palat cut it to 2-1 at 2:11 of the second period on a one-timer from the right circle.

Brendan Smith tied it 2-2 at 9:53 with a one-timer from the slot off an assist from Bratt.

Bratt then set up Hischier, who gave New Jersey a 3-2 lead at 11:24 on a one-timer from below the right circle.

"I think we lulled ourselves to sleep and weren't really playing the way we wanted to play in the second," Kreider said. "We were able to get back into it."

Kakko tied it 3-3 at 5:32 of the third after Luke Hughes' stick broke on an attempted shot. Kakko took the puck down, protecting it from Hughes and scoring from the left circle.

"A little bit unlucky in the third," Green said. "We're in the offensive zone looking to score a goal and break a stick. And they score a power-play goal."

Smith went to the box for hooking Jack Roslovic at 13:38, opening the door for Kreider's game-winner.

"Our guys, they stuck together tonight," Laviolette said. "In the end, the guys on the ice in the third period fought hard for the guys who fought early. So, it was a positive. At the end, it's a real positive night for us."

NOTES: The Rangers went 4-0-0 against the Devils this season, the third time they've swept the season series against them (1993-94, 2014-15). … Panarin has 16 points (seven goals, nine assists) during a seven-game point streak. … Kakko has a five-game point streak (three goals, two assists), tying his career high.