Rangers goalie Igor Shesterkin, left, is congratulated by teammates led...

Rangers goalie Igor Shesterkin, left, is congratulated by teammates led by defenseman Braden Schneider (4) after they defeated the Arizona Coyotes in an NHL hockey game Sunday at Madison Square Garden. Credit: AP/John Munson

After losing the front end of a back-to-back set Saturday night in Nashville, the Rangers, to a man, insisted that they had played well. Captain Jacob Trouba said if they continued to play that way, it would pay off eventually and they would win a lot of games over the course of the season.

And then came Sunday, when the Rangers, to a man, acknowledged that they didn’t play particularly well — yet they won anyway.

Goals by Barclay Goodrow and Adam Fox in the final five minutes of the second period and a power-play goal by Chris Kreider at 4:39 of the third lifted the Rangers out of their doldrums and powered them to a 4-1 victory over the Arizona Coyotes at Madison Square Garden. The win gave them an important two points before they leave for a four-game trip to Seattle and California.

“It just makes you smile, I guess,’’ Trouba said. “And it is a game we play. We’ve all got to remember that.’’

“Yeah, sometimes this game doesn’t totally make sense,’’ Chris Kreider said. “I mean, we didn’t play well in the first 20, come away 0-0 and are able to find it, find a way to win.’’

Goalie Igor Shesterkin was a big reason the Rangers (8-6-3) were able to win. He made 31 saves, including 17 in the first period as the Rangers were outshot 17-4. He earned his eighth win of the season.

“It’s like last year,’’ coach Gerard Gallant said. “Last year I said plenty of times .  .  . that our goalie, you know, stole the game for us. I mean, I don’t think he had to steal it tonight because we did play a good second half. But he definitely kept it scoreless, and that was important.’’

Both teams were playing for the second straight night, but the Rangers had flown home from Nashville and the Coyotes merely drove across the Hudson River after playing the Devils in Newark. So that may have had something to do with how little hitting there was early and the Coyotes’ shot advantage in the first period.

The second period started off much the same way, except the Rangers kept taking penalties. But it seemed as if the Blueshirts somehow were starting to generate offensive momentum on their penalty kill.

“We couldn’t get our legs going,’’ Gallant said. “And then all of a sudden, we had a couple of good PKs .  .  . and everybody started to jump from that point on.’’

The Rangers finally got on the board at 15:05 of the second period, 16 seconds after Vincent Trocheck came out of the penalty box following his interference penalty.

Trouba pushed the puck up to Trocheck in the offensive zone and drove to the net. Trocheck sent a pass to Trouba that failed to connect, but the Coyotes turned the puck over when defenseman Juuso Valimaki’s attempted clearing pass went off the stick of Dylan Guenther and ricocheted on net, forcing goalie Connor Ingram to make a save. The rebound went straight to Goodrow, who whipped a shot past Ingram for his fourth goal of the season.

The Rangers woke up after that and quickly doubled their lead on a brilliant individual effort from Fox. He went behind the Arizona net and sent a pass out to Filip Chytil in front. Chytil’s shot was blocked, but Fox circled the net and retrieved the loose puck, skated to the slot and fired a wrist shot past Ingram to make it 2-0 at 16:23.

Kreider deflected in a shot by Mika Zibanejad to make it 3-0 before Clayton Keller scored on a power play to end Shesterkin’s shutout bid at 8:33.

Before Arizona could mount a comeback, Ryan Carpenter scored his first goal as a Ranger at 11:43 to seal it.

More Rangers

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME