Kaapo Kakko of the Rangers celebrates his second-period goal against the Kraken...

Kaapo Kakko of the Rangers celebrates his second-period goal against the Kraken with his teammates at Madison Square Garden on Tuesday. Credit: Jim McIsaac

All season long, as they jumped out to a fast start and rose to the upper tier of the NHL standings, the Rangers have relied on the offensive production of Artemi Panarin and his linemates, Vincent Trocheck and Alexis Lafreniere.

But as good as those three have been, the Rangers were always going to need contributions from their other lines as the season went along. On Tuesday night at Madison Square Garden against the Seattle Kraken, they got them.

Blake Wheeler had two goals, Kaapo Kakko — in his second game back after a 21-game absence because of a left leg injury — had a goal, and goaltender Igor Shesterkin delivered his best game of the New Year as the Rangers beat the Kraken, 5-2.

The Rangers have two straight wins to begin the second half of their season after they closed the first half with four straight losses.

“The balance was good, the scoring was good. We needed that,’’ coach Peter Laviolette said afterward. “We hadn’t really had that the last few games. It seemed like we were pressing, pressing, pressing. We couldn’t get it to go [in]. I’m telling you, it was nice to score some goals.’’

And it was especially nice to get them from somewhere other than the Panarin line.

Trocheck did score the first goal, on a power play, off a pass from Panarin at 8:22 of the first period. It was Panarin’s 60th point of the season.

But the Rangers got goals later from Wheeler, Kakko and defenseman Erik Gustafsson, who went 31 games without one. That was a good sign for a Blueshirts team that improved to 28-13-2 (58 points) and stretched their lead in the Metropolitan Division to four points over idle Philadelphia.

“Without question,’’ Wheeler said when asked if it was big to have the other lines carry the load for a night. “I mean, between [the Panarin line], and the power play and penalty kill and goaltending, that’s kind of been the story for our team. I think down the stretch, and as you get closer to playoff time, you need everyone contributing.

“And certainly those guys are going to be looked to to carry the load offensively for us every night, but you know, we’ve all got to chip in.’’

After Trocheck opened the scoring on the Rangers’ second power play — ending a run of nine straight unsuccessful man advantages — Seattle (19-16-9) tied it on a power-play goal, capitalizing on a turnover by Trocheck in the neutral zone to get a goal from former Islander Jordan Eberle at 10:41.

But Gustafsson restored the Rangers’ lead just 28 seconds later, skating onto a loose puck at the top of the slot and whipping a shot past Chris Driedger (18 saves) for his fourth goal of the season and first since Nov. 4.

The Kraken were without their leading scorer, defenseman Vince Dunn, and No. 1 center, Matty Beniers, and were playing the second night of a back-to-back after losing in Pittsburgh on Monday.

Seattle still put a fierce push on to start the second period, outshooting the Rangers 14-6 midway through the period. Shesterkin, who made 29 saves to improve to 18-10-0, was superb in that middle frame, stopping all 16 shots that he faced.

Wheeler’s first goal, a tip-in of a shot by his linemate, Jonny Brodzinski at 12:32, extended the lead to 3-1.

Kakko’s goal, a one-timer off a soft, two-on-one pass from Mika Zibanejad, made it 4-1 at 17:01. It was his third goal of the season, in 22 games, and his first since Nov. 20.

“It felt good,’’ said Kakko, who had talked at the morning skate about his need to score a goal. “Always when you score a goal you feel good . . . but it’s very good. I got a couple chances before that and couldn’t hit the net, so that one went in, and it felt good.’’

A second Kraken power play goal, this one by Jared McCann at 14:24 of the third, pulled Seattle within 4-2, but Wheeler’s second, into an empty net with 2:38 left, sealed the result.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME