It was 2-1 Rangers with two minutes to go in the second period after the lead had been 2-0 on the Islanders when Team Floor’s Michael Grabner steamed in on Henrik Lundqvist from the right side on a shorthanded breakaway.

It was the kind of game-defining moment of which the King had been on the wrong side a bit too often through the early weeks of the season. It was the kind of moment that called for a confidence-lifting save for both the goaltender and his team.

“The difference might only be one save a game, but that can be the difference between winning and losing,” Lundqvist had told The Post following the morning skate. “One save a game and it can be a whole different story; it’s a fine line.

“I don’t think I’m that far away, I don’t think I’m playing badly but I know I’m not where I want to be and need to be.”

But when Grabner cut across the crease, Lundqvist was exactly where he wanted to be and needed to be. The goaltender flashed the right pad, preserving the Rangers’ advantage and setting the stage for teen angel J.T. Miller — who had lost the puck to Grabner — to score less than a minute later on the power play for his second goal of the night and second of his NHL career, extending the lead to 3-1 in what became a 4-1 victory.

“I feel I have been doing the right things, but it definitely feels good to be rewarded,” Lundqvist told The Post after winning for just the fourth time in nine starts. “It’s tough to feel good about yourself when you’re not winning.”

The Rangers improved en masse last night. They were quicker to the puck and stronger on it. The pace was good. Ryan Callahan’s return provided added jam, the captain leading by example — what else? — while skating on a line with fellow Americans Miller and Chris Kreider.

The power play, 3-for-35 coming in, went 1-for-2. The penalty kill, 9-for-41 through the opening nine matches, snuffed all five Islanders advantages. And the Rangers scored first for only the third time this season.

“It’s a different game when you play with the lead,” said Lundqvist, who was beaten only by sniper John Tavares’ rising wrist shot midway through the second. “You can be a little more relaxed.”