The Islanders have made a habit of letting their opponents hang around after gaining leads, but they didn’t let this one slip away.

Despite a dominant first-period performance in which the Islanders emerged with a commanding three-goal advantage, the Flyers rallied with a two-goal second period and tied the game with 93 seconds left in the third.

But the Islanders prevailed, with Ryan Pulock notching a last-minute goal to take a 5-3 win at Barclays Center on Tuesday night, extending their point streak in Brooklyn to 15 games, dating back to last season.

The Islanders couldn’t build off of their first period, allowing Philadelphia to have its way in the second. Going on the power play at 14:34 of the second when Kevin Hayes was sent off for tripping, the Islanders watched as the Flyers had the best opportunity of the stretch, when winger Michael Ruffl nearly scored on a shorthanded breakaway.

But the Islanders’ strong start enabled them to pick up a win before their upcoming four-game road trip.

It wasn’t all good new for the Islanders, who lost a key player in the first period. Casey Cizikas collided with Ivan Provorov in the corner and went down hard. He had to be helped off the ice, unable to put any weight on his left leg and did not return.

The Islanders’ first line set the tone early, buzzing from the initial puck drop and generating a handful of shots in the opening minutes. Josh Bailey finished what they started, one-timing the puck from the slot before it was deflected off a Philly stick and in for a 1-0 lead at 7:45 of the first. It was his fifth point in the last five games.

The Islanders’ second goal came on a well-executed two-on-one between Matt Martin and Leo Komorav, which led to Martin scoring his fifth goal of the season at 11:13. The Islanders weren’t done as Jordan Eberle scored at 15:306 on a put-back off a rebound of a Mathew Barzal shot on goal that was stopped by goaltender Brian Elliot after Barzal’s strong move around the Flyers’ net.

At that point, the Islanders had three goals on just nine shots.

Philadelphia got on the board at 9:34 of the second on a goal by Travis Konecny. Roughly 2 ¹/₂ minutes later, Robert Hagg capitalized on a rebound to make it a one-goal game with just over eight minutes left in the middle frame.

Sean Couturier knotted the game 3-3 with 93 seconds left in regulation, before Pulock saved the day with the game-winner seconds later. Leo Komorav sealed the deal with an empty-netter.