Ryan Malone and J.T. Wyman also had goals to help the Lightning win their third straight game. It's a little too late for Tampa, which is 11th in the Eastern Conference and seven points out of a playoff spot with seven games remaining.
Wayne Simmonds, Matt Read and Scott Hartnell scored Philadelphia's goals. The Flyers lost for just the third time in 14 games this month. They've already clinched a playoff berth, but are four points behind Pittsburgh for fourth place and the home-ice advantage in the first round that goes with it.
Dwayne Roloson stopped 35 shots, outplaying Ilya Bryzgalov. The Lightning had just 11 shots through the first 52 minutes, scoring on three of them.
Bryzgalov let the first shot he saw go in for the second time in three games, and the Flyers fell behind 1-0 for the 16th time in 21 games.
St. Louis put the Lightning up 3-2 on a breakaway goal 2:27 into the third. St. Louis got in front of Philadelphia's defense, took an outlet pass from Tim Wallace, skated in and beat Bryzgalov by lifting a shot just under the crossbar.
Bryzgalov hadn't allowed more than two goals in his past 11 games.
There was nothing Bryzgalov could do on the fourth goal. Matt Carle turned the puck over behind the Flyers' net and Wyman poked it in behind an unsuspecting Bryzgalov.
That turned out to be a critical goal because Hartnell fired a slap shot between Roloson's legs to cut it to 4-3 with 1:13 left. Tom Pyatt's empty-net goal then sealed the win for the Lightning.
Trailing 2-0 for the fourth time in the past five games, the Flyers started their comeback early in the second when Simmonds scored his first goal in 17 games. Simmonds started a breakaway along the left wing, played give-and-go with Brayden Schenn and tipped a shot in off a centering pass.
Read scored his 22nd goal to tie it at 2 late in the second. Kimmo Timonen set it up with a backhanded crossing pass. Read fought off a defender and dove forward to deflect the puck past Roloson. He finished the game tied with Colorado's Gabriel Landeskog for most goals among rookies.
Malone gave the Lightning a 1-0 lead in the first when he scored a short-handed goal after a turnover by Danny Briere at center ice. Malone stripped the puck away from Briere, broke in and fired a shot into the top corner.
Stamkos blasted a slap shot through a screen over Bryzgalov's shoulder with just 1.4 seconds left in the first to make it 2-0. Team captain Vincent Lecavalier held the Lightning record with 52 goals in 2006-07.
Notes: Malone's goal was just the second short-handed goal this season for Tampa. ... D Victor Hedman was a late scratch for the Lightning because of an illness. ... Stamkos has 11 goals and five assists in 15 games vs. Philadelphia. ... Simmonds hadn't scored since Feb. 21. He has a career-best 23 goals. ... Malone has five goals and 10 assists in his past 19 games. ... Timonen's assist was his 400th in the NHL.