The Flyers got to within 3-1 - and woke up the crowd - when Matt Read tipped in Sean Couturier's shot with 9 minutes, 12 seconds left. Less than three minutes later, Islanders goalie Evgeni Nabokov (40 saves) robbed Wayne Simmonds out front.
Grabner's empty-net goal came with 0.8 seconds remaining.
The Flyers, who had few chances on their four power plays and committed numerous turnovers, have won just 11 of 20 games at home (11-7-2); they are a league-best 16-7-2 on the road.
Couturier had his five-game goal-scoring streak snapped.
The Islanders took a 1-0 lead when Moulson, who earlier had a goal overturned because he kicked the puck into the net, scored after being left alone in the slot 28 seconds into the second period. Moulson was set up by John Tavares, who increased his point streak to 11 straight games.
Flyers goalie Sergei Bobrovsky stopped all 12 shots in the first period. He was given the start because of his eye-opening career totals against the Islanders before Thursday: a 7-0 record, a 1.86 goals-against average, and a .944 save percentage.
Earlier in the week, Flyers coach Peter Laviolette looked at upcoming games against Minnesota and the Islanders as he planned his goalie rotation.
"And if we wanted to get Bob into a game here, it made sense to go with the Islanders, where he's had some success," Laviolette said before the opening faceoff.
Bobrovsky stopped Grabner on a shorthanded breakaway early in the second period. The Flyers got another power play about five minutes later, but again it was the Islanders who had the best scoring chance. Again, Bobrovsky stood tall, denying Tavares as he was ahead of the pack.
Later on the same power play, Evgeni Nabokov, in his best save of the first two periods, stopped Jaromir Jagr from out front. That kept the right winger goalless in his last seven games.
With about 71/2 minutes left in the second period, Bobrovsky stopped Tavares on a two-on-one, and Jakub Voracek cleared the puck out of the crease as it came precariously close to the goal line.
But the Flyers continued to struggle on the power play. A Kimmo Timonen turnover led to Bailey's shorthanded breakaway, and he gave New York a 2-0 lead, scoring on a backhander with 7:02 left in the second period.
It was the Isles' third shorthanded breakaway of the game.
Claude Giroux, the Flyers' all-star center who is mired in a goal-scoring slump, tried to energize his team by getting involved in a (fairly even) fight with Dylan Reese with 2:19 left in the second period.
It didn't work.
Heading into the final period, the Isles appeared on their way to snapping a losing streak at the Wells Fargo Center that dated back to 2007.
Contact staff writer Sam Carchidi at email@example.com or @BroadStBull on Twitter.