PHILADELPHIA — If anyone doubted Henrik Lundqvist’s resolve, remove that doubt.

Playing 24 hours after the Rangers’ dreadful performance in a loss to the Buffalo Sabres at Madison Square Garden, Lundqvist, who admitted that he had to make more key saves, put on a vintage show and made the difference in a 5-2 victory at Wells Fargo Center.

Kevin Hayes and Michael Grabner each scored twice and playing five-on-five, the Rangers were more focused and crisper than in the 4-1 loss to Buffalo on Tuesday, had better forechecking, backchecking and puck support and attempted shots from all over for their NHL-leading 14th road win.

“It was important to show ourselves that we we’re better than that,” said Lundqvist. “We all felt we had to respond. We haven’t been able to pull a big winning streak together but we’ve been able to respond quickly when we have a letdown, which is important if you want to stay in the hunt.”

Lundqvist, who came into the game 32-13-4 against the Flyers, made 30 saves but lost his bid for his second shutout of the season when Jakub Voracek’s pass to Wayne Simmonds on a power play late in the third deflected off Ryan McDonagh’s skate and slid past the Swedish netminder. And with the Blueshirts up 4-1, the Flyers scored again with 2:42 left.

Single-handedly, Lundqvist kept the Blueshirts (27-13-1) in the game in the scoreless first period, first by stopping Simmonds on a shorthanded breakaway when he poked the puck from McDonagh at the Flyers’ blue line, and then with a five-save flurry on quality shots, four of them during a Flyers’ power play.

advertisement | advertise on newsday

Hayes provided a 1-0 lead early in the second period when Flyers defenseman Brandon Manning made an ill-advised pinch along the left boards in the Rangers’ zone and had the puck stolen by Grabner, who sent Hayes up ice on a 2-on-1 with Jesper Fast. Hayes looked left, but drove to the net, went backhand to forehand and top shelf past Steve Mason for his 12th at 2:08.

“I was playing with two guys who move the puck and had two opportunities on the rush,” said Hayes. “On both of them the d-man went down, I usually pass but tonight, I shot.”

Right after Hayes’ goal, at 4:17, Lundqvist made two stunning saves on Brayden Schenn, batting away the first shot from the right side with his glove and then diving to foil his backhanded rebound and cover.

In the third, the Rangers showed no signs of fatigue, scoring three times.

Mats Zuccarello settled down the puck and flipped it softly to Derek Stepan, coming in on a rush with Chris Kreider. Kreider went to the slot, avoiding two converging Flyers and beat Mason for a 2-0 advantage at 5:01. His team-leading 16th goal was his fifth in four games, and put that line, which had been blanked against the Sabres, on the board. After some strong forechecking, J.T. Miller found Grabner to the left of Mason with 8:47 left.

Hayes then scored his 13th on an odd-man rush. The play was challenged by coach Dave Hakstol, who argued that Grabner was offside. But the goal stood after a review, and Grabner fired in his second into an empty net at 17:45.

Before the game, coach Alain Vigneault was asked if he had made any reference to the sluggish debacle on Tuesday.

“I don’t think I should need to say a word,” he said. “These players are professionals.”

He was right. Lundqvist and the Rangers responded.

“I felt like I competed really well,” said Lundqvist. “When we’re all engaged, you can sense it, it started in the first period. I think the focus was there tonight, and that was the difference.”