The Flyers (3-7) hadn't scored more than two goals in any of their first nine games. One more and they would have become the first NHL team to have a season-opening run of 10 games without three goals since the 1940 New York Americans.
Now Philadelphia has won two straight since a franchise-worst 1-7 start.
Jakub Voracek and Matt Read also scored, and former Islanders captain Mark Streit added two assists.
Kyle Okposo and Frans Nielsen had goals, and Kevin Poulin made 27 saves for the Islanders, who couldn't build on a come-from-behind win at Pittsburgh on Friday.
Lecavalier opened the scoring with a power-play goal 4:30 in. The 33-year-old center, who joined the Flyers after the Tampa Bay Lightning bought out his contract, scored his second of the season on a slap shot from the top of the right circle.
Streit, returning to Long Island for the first time since joining the Flyers, passed the puck to Lecavalier from the point.
Voracek made it 2-0 a minute later, but Okposo got the Islanders back within a goal at 10:16.
Lecavalier increased the lead to 3-1 with his second of the game at 18:13. Streit also assisted as did rookie left wing Michael Raffl, who earned his first NHL point.
Lecavalier, who has 387 career goals, completed the hat trick with his fourth goal of the season at 9:53 of the third. Nielsen's short-handed goal midway through the second had cut New York's deficit to 3-2.
Read added an empty-net goal with 1:32 remaining to seal the Flyers' first road win of the season.
Poulin made just his second start of the season for the Islanders (4-4-3). His only other outing in place of No. 1 goalie Evgeni Nabokov was a 3-2 loss at Chicago on Oct. 11.
The Flyers are 16-3 at Nassau Coliseum since the 2007-08 season and 30-7-1-2 in their last 40 games there.
Islanders captain John Tavares assisted on Okposo's goal to extend his point streak to 10 games. The only game he has been kept off the score sheet was the season opener at New Jersey on Oct. 4.
Nielsen's goal at 10:30 of the second was his seventh of the season and gave him a four-game goal streak. He leads the Islanders with 15 points.
NOTES: Flyers forward Scott Hartnell returned after missing four games with a rib injury. ... The Islanders were without defenseman Lubomir Visnovsky (concussion) for the third straight game. ... Forward Michael Grabner returned for New York after a two-game suspension for a hit on Carolina's Nathan Gerbe. ... Former Islanders goalie Rick DiPietro, whose contract was bought out by New York, signed a tryout contract with the AHL Charlotte Checkers.