Ryan Carter snapped a tie with just under five minutes left in the third period to put the New Jersey Devils one game away from reaching the Stanley Cup final.

Devils captain Zach Parise added an empty-net goal in the 5-3 victory over the New York Rangers at Madison Square Garden on Wednesday.

New Jersey stormed out to a 3-0 lead by midway through the first period on goals from Stephen Gionta, Patrik Elias and Travis Zajac, only to watch the Rangers chip away until the lead had completely evaporated by early in the third period.

Brandon Prust scored late in the first, and Rangers captain Ryan Callahan and Marian Gaborik each scored goals in the first minute of the subsequent two periods.

Martin Brodeur made 25 saves and is one game away from reaching the fifth Stanley Cup final of his storied career.

Rangers netminder Henrik Lundqvist gave up four goals for the first time in the playoffs, finishing with 12 stops.

Game 6 will be in New Jersey on Friday night (CBC, CBCSports.ca, 7:30 p.m. ET).

If the Rangers can stay alive then, Game 7 would be back in Madison Square Garden on Sunday.

"I thought we probably played our best game of the series tonight," Rangers coach John Tortorella said.

Once Gaborik tied it with an unassisted goal that ricocheted in off the skate of goalie Brodeur, it appeared the Rangers would ride the comeback all the way to one of the most stirring wins in team history — one that would rival victories over New Jersey in the classic 1994 East finals.

Carter made sure it wouldn't happen.

Ilya Kovalchuk knocked Michael Del Zotto off the puck in the right corner, and Gionta sent a pass in front to Carter — who had just charged in front from the bench — for a quick shot that beat Henrik Lundqvist.

"You have to [keep it together] this time of year," Gionta said. "You have to have a short memory. Fortunately we did and came out with the victory."

New Jersey was outshot 28-17 overall and had only six shots in the third period, but two of them went in. Now the Devils are on the verge of their first Cup finals appearance since they won their third title in 2003.

Brodeur who has been the backbone of every Devils championship kept his focus throughout the third period when he was loudly taunted with chants of "Mar-ty, Mar-ty" after New York got even.

The Rangers were ultimately done in by another terrible start. For the 13th straight game in these playoffs, the team that scored first in New York's contests has gone on to win. The Rangers had been on a pattern of win-one, lose-one, but now they are on the verge of elimination with their second two-game losing streak in a series this year.

The only time the Rangers have won two straight in a playoff series is when they overcame a 3-2 hole in the first round and knocked out Ottawa.

The Rangers burned their timeout in the first period, and Devils coach Peter DeBoer spent his with 10:17 left in the game after his club was forced to ice the puck.

New Jersey surely never thought it would be in this kind of fight after storming in front early.

Not only didn't the Rangers have the strong start they craved and insisted they needed, they were practically run out of their building less than 10 minutes in.

The same problems that plagued New York in its 4-1 loss in Game 4, when the Devils jumped out to a 2-0 lead in the first period, cropped up again in front of the home fans that grew frustrated and angry early.

Gionta got the Devils going 2:43 in when he gathered a rebound of Mark Fayne's shot right in front of Lundqvist, steadied himself without any pressure from the defense, and slipped in his third goal of the playoffs to start the barrage.

Elias made it 2-0 just 1:30 later on New Jersey's fourth shot of the night.

After Kovalchuk fumbled the puck just inside the blue line, he dived to keep it from leaving the Rangers' zone. The puck eventually came to Adam Henrique at the right point for a shot that was stopped by Lundqvist. Elias got it in front and scored his fourth.

Tortorella used his timeout then, but it made little difference. He appeared to be calm as he moved back and forth behind the bench while talking to his players. Whatever the message was didn't sink in.

New York generated a couple of scoring chances soon after that were either turned aside by Brodeur or thwarted by the Rangers themselves. Gaborik was set up in front after teammate Ruslan Fedotenko got the puck to him after a wraparound the Devils net, but the Rangers' struggling leading scorer fired a shot over the net from close range.

Fedotenko was in the middle of another chance moments later when he sent a shot in on Brodeur. The rebound came out to Derek Stepan, whose drive from in close was smothered by Brodeur.

The Devils shrugged those off and went back to padding their lead.

Just 5:26 after Elias' goal, Zajac made it 3-0 with his seventh of the playoffs. Bryce Salvador wiped out Rangers defenceman Ryan McDonagh in the offensive zone and started the play going the other way. Zajac got a clean shot from just inside the right circle that sailed past Lundqvist and beat him inside the left post at 9:49.

The tide began to turn the Rangers' way the rest of the period as they allowed only one shot the rest of the period and began cutting into the seemingly insurmountable deficit.

Prust, making his return following a one-game suspension for an elbow he delivered to the head of Devils defenceman Anton Volchenkov in Game 3, showed off a bit of scoring touch when he converted on a breakaway with 4:19 left in the first.

Devils defenceman Marek Zidlicky turned over the puck in the neutral zone to Fedotenko, who fed a pass to the streaking Prust in the New Jersey end. Prust surged past the hardcharging Zidlicky and slid a backhander past Brodeur for his first goal of the playoffs.

The Rangers managed to outshoot the Devils 9-6 in the lopsided first period, but continued their sudden defensive dominance well into the second. But not before they cut the Devils' lead down to a goal just 32 seconds into the second.

Brandon Dubinsky, back from a foot injury, fired a shot from the left point that was deflected in front and caromed toward the left corner. Artem Anisimov flung the puck back toward the crease and it struck the left skate of the driving Callahan and got past Brodeur. The goal stood up after a brief video review.

John Mitchell was scratched to make room for Dubinsky.

New Jersey didn't record its first shot of the period, and its second since its third goal, until Henrique put a puck in on Lundqvist 6:23 into the frame.

Lundqvist made just 12 saves en route to the loss and the Rangers allowed five goals for the first time all postseason.

To make the finals now, New York will have to win a third consecutive seven-game series. The Rangers have already played 19 postseason games.

With files from CBCSports.ca