Anthony Beauvillier had two goals, and Mathew Barzal also scored for New York (14-3-1), which trailed 3-0 after the second period. Thomas Greiss made 28 saves.
The Islanders are 13-0-1 in their past 14 games, their longest streak since winning 15 in a row from Jan. 21-Feb. 20, 1982.
"We were definitely in a hole there going into the third," Barzal said. "At that point, you just want to go out and get one and go from there. ... I don't know what it is with this group. We knew we'd be in the fight right to the end, and that's what we did tonight."
WATCH: [All Islanders vs. Flyers highlights]
Sean Couturier, Ivan Provorov and Oskar Lindblom each had a goal and an assist for Philadelphia (10-6-4). Brian Elliott made 33 saves.
"We did not play the way we need to play [in the third period]," Provorov said. "We sat back and started making mistakes, turning the puck over in the neutral zone and not getting the puck out of our zone when we needed to."
New York tied the game with 2:04 left when Beauvillier's second goal of the game bounced past Elliott.
"Just trying to get it on net," Beauvillier said. "Good bounce. One of those bounces you're happy to have them when they come."
He scored the Islanders' first goal when a bad Flyers line change allowed him to break in on Elliott and slide a puck along the ice between his pads at 7:46 of the third.