Rick Nash of the Rangers celebrates his first-period goal against...

Rick Nash of the Rangers celebrates his first-period goal against the Flyers with his teammates at Madison Square Garden on Tuesday, Jan. 16, 2018. Credit: Jim McIsaac

Brady Skjei could sense it before Tuesday’s game.

“When you walked in the locker room today, you could tell everyone had a little chip on their shoulder and we had something to prove,” the Rangers defenseman said.

After all, the Blueshirts had lost three straight, surrendered too many shots against, and had not won in regulation in 10 games.

“We really wanted to focus on our defense and eliminating odd-man rushes and I think we did that,” Skjei said. “It was a five-man game for sure.’’ As a bonus, the Rangers scored five goals for the first time since Dec. 9, including a pair from Rick Nash that ended his 12-game drought, and rolled past the Flyers, 5-1, at Madison Square Garden.

“It’s only one game,” said Nash, who has 11 goals this season. “It’s not that big of a deal to me. It’s what I’m supposed to do, so I’m going to keep working on my game and try to come back even better against Buffalo [on Thursday.]”

The Rangers rebounded from an early 1-0 deficit with three consecutive goals in the first period, scoring each in a different way against Flyers goalie Brian Elliott: Nash, on a breakaway at even strength, J.T. Miller on a deflection on the power play and Paul Carey, roofing a shot shorthanded with 9.4 seconds to play. It was the first shorthanded goal of the season for the Rangers.

Michael Grabner added his team-leading 20th of the season after a steal in the second, Nash scored again off a rush and the rout was on. Michael Neuvirth replaced Elliot, who stopped just 16 of 21 shots, to start the third period.

“I thought I didn’t really give ourselves a chance to win,” Elliott said.

At the other end of the rink, Henrik Lundqvist did.

His timliest save came with the score tied at 1 and with the Blueshirts on a power play. The Flyers broke out on a two-on-one and Lundqvist denied Claude Giroux’s open look. Seconds later, Miller, in front, got his stick on Ryan McDonagh’s high shot and the puck changed direction and went by Elliott for the go-ahead goal.

“A big turning point,” coach Alain Vigneault said.

Lundqvist, who made 25 saves, became the first goaltender in NHL history to earn 20 or more wins in each of his first 13 seasons, and the first with at least 20 wins in 13 consecutive seasons at any point during the course of a career.

“We played our best defensive game in a very long time,” Lundqvist said. “You start in your own end and take care of business there. Your breakouts are better, your speed and timing are better. We’ve been talking about it for a long time and tonight it clicked.”

The Flyers had won four straight and were blanked on three power-play opportunities.

With the Islanders loss, the Rangers (23-17-5, 51 points) moved past them into a wild-card spot.

About the lone negative was that defenseman Marc Staal didn’t play in the third period with a hip flexor issue. Vigneault said he didn’t think it was too serious, but would know more on Wednesday.

“You can get real good offense when you’re playing defense,” Vigneault said. “You look at our fourth and fifth goals, quick counter plays where we scored because we caught them a little bit deep. Tonight, we executed.”

More Rangers