ANAHEIM -- The New York Rangers scored five consecutive goals, including four in the third period to rally for a 5-2 win against the Anaheim Ducks at Honda Center on Sunday.

Chris Kreider had a goal and two assists, and Artemi Panarin and Vincent Trocheck scored for the Rangers (29-15-2), who had lost two straight and were coming off a 2-1 loss at the Los Angeles Kings on Saturday. Adam Fox had two assists and Igor Shesterkin made 16 saves.

"We worked tonight, the win was hard," New York coach Peter Laviolette said. "As the game moved on, we were having a hard time climbing back into it, so the fact that we just stuck with it, I thought was a really great job by the guys."

Adam Henrique scored twice, and Troy Terry and Leo Carlsson each had two assists for the Ducks (15-30-1), who have lost three in a row and five of seven (2-5-0). Lukas Dostal made 28 saves for Anaheim, which was coming off a 5-3 loss at the San Jose Sharks on Saturday.

"That was our best line, it might have been one of the best lines on the ice," Ducks coach Greg Cronin said of Henrique, Terry and Carlsson. "You can't win a hockey game with one line going, though."

NYR@ANA: Panarin takes the lead with incredible PPG

Will Cuylle tied it 2-2 at 10:10 of the third on a deflection off a point shot from Jacob Trouba.

"I was kind of pinned in the corner and I just tried to fight to get to the front of the net," Cuylle said. "It was a good shot by 'Troub' to get it through, and I just tried to get a stick on it."

The Rangers then scored two goals in a span of 1:44.

Panarin gave New York a 3-2 lead at 14:23 on the power play with a one-timer from the left circle. Kreider extended it to 4-2 at 16:07, scoring off his own rebound off the rush.

Jimmy Vesey scored into an empty net with 36 seconds remaining for the 5-2 final.

"We played an awesome third period," Panarin said.

NYR@ANA: Kreider bats his own rebound into the net for 4-2 lead

Henrique gave the Ducks a 1-0 lead 51 seconds into the first period on the first shot of the game when Carlsson fed him cutting through the right circle and he lifted a backhand over the left shoulder of Shesterkin.

"Certainly enjoying playing with those guys," Henrique said of Terry and Carlsson. "Hopefully, we can keep the chemistry going."

Henrique made it 2-0 at 15:37 after scoring off a loose puck in front of the crease.

"I thought we were controlling most of the game, but that doesn't matter," Laviolette said. "You find yourself down one, down two, and it's just not the start that you wanted."

Trocheck cut it to 2-1 at 17:58 of the second period with a power-play goal on a one-timer from the slot off a pass from Kreider following a carom off the end boards.

Anaheim appeared to take a 3-1 lead at 5:06 of the third period on a goal by Mason McTavish, but the Rangers challenged for offsides and the goal was waived off following a video review.

"We definitely could have just laid down there in the third being down and, obviously, we got fortunate with that offsides call there," Fox said. "The breaks really haven't gone our way, it seems, and that one went our way, and we got some momentum too."

NOTES: The Rangers are 8-0-0 in the second half of back-to-back games this year. ... Trocheck has 15 points (seven goals, eight assists) in his past 12 games. ... Panarin has at least one point in 38 of his 46 games this year, the second-most games with a point in the NHL this season behind Nathan MacKinnon of the Colorado Avalanche (40). ... Kreider scored his 127th road goal with the Rangers, moving him past Camille Henry for fourth most in team history. ... Rangers defenseman Erik Gustafsson had two shots on goal in 15:55 after missing the loss to the Kings on Saturday. ... Henrique has nine points (four goals, five assists) in his past eight games. ... Terry also has nine points (two goals, seven assists) in his past eight games.