John Tavares, center, celebrates with Islanders teammates after scoring his...

John Tavares, center, celebrates with Islanders teammates after scoring his 24th goal in the first period against Pittsburgh Penguins on Tuesday, March 8, 2016 at Barclays Center. Credit: Jim McIsaac

This was a battle, another installment of an Islanders-Penguins feud that stretches back a few seasons but has more meaning now that the teams are tight in the standings.

The Isles battled through a wild final 10 minutes, pulling ahead on Anders Lee’s power-play goal with 11:05 to go and willing themselves to a 2-1 win Tuesday night despite seeing Jaroslav Halak crumple and skate off with an apparent groin injury with 4:22 to play.

Thomas Greiss came on cold, made three saves and got one huge assist from Travis Hamonic, who got a skate on Phil Kessel’s one-timer with five seconds left to preserve the victory. It was the Islanders fourth straight win and seventh in their last eight games, moving them five points ahead of the Penguins in the Metropolitan Division with two games in hand.

“I had the shot-blockers on [my skates], so I might as well use ’em,” joked Hamonic. “Jaro played great for us and Greisser came in and held it down.”

Halak had 31 saves in a strong bounce-back performance from a shaky outing in Sunday’s 6-4 win over the Rangers, starting with a terrific stop on Kessel in the game’s first minute.

Halak stretched to stop a point shot in the third when he grabbed his leg and fell, face-first, to the ice. Isles trainer Damien Hess came to attend to the goaltender, who got to his feet and headed straight for the door that leads to the dressing room.

Greiss had a television timeout to get his gear on, stretch his arms a bit and get set. He was greeted with a Penguins power play just six seconds later, but the Isles’ penalty kill was ferocious to complement the 2-for-4 night on the power play, with Lee and John Tavares providing the goals.

“It happens,” the ever nonplussed Greiss said after the win. “When you come in like that, you get into it pretty quick. The guys did a great job. I didn’t really have that much to do.”

Jack Capuano had no update after the game but it seemed apparent that Halak would not be traveling to Toronto on Tuesday night for Wednesday’s game with the Leafs.

Lee had plenty to do in front of Marc-Andre Fleury during the Isles’ power plays in the third. Tavares and Kris Letang traded first-period goals and Halak held the fort in a Penguins-tilted second period; in the third, the Isles got an early power play that was nullified by Lee slashing Ian Cole’s stick after Cole cross-checked Lee five or six times.

The big Islanders forward was furious, but his team killed off that minor and he went back to his spot in front of Fleury when Matt Cullen cross-checked Ryan Pulock with 11:25 to go.

Lee and Letang tussled as Nick Leddy readied a point shot. Letang clubbed Lee up high, but the bigger Lee muscled Letang to the ice just as the shot grazed Lee’s leg and squeezed past Fleury for the eventual winner.

“Fearless,” Capuano said of Lee. “It’s sacrifice. He does it. Other guys need to do it. But that’s what he does for our team.”

The Islanders have allowed two goals or fewer in five of their past eight games. Halak was in net for four of their past seven wins, but the prospect of losing him for an extended period is not as daunting as it could have been with Greiss, the league’s save percentage leader, playing so well behind Halak.

“I have confidence in all our goalies,” Capuano said. “They both played extremely well here.”

More Islanders