The Lightning (7-3-1) have won the first two of their four-game homestand.
Stamkos, who has eight goals through 11 games, gave the Lightning a 2-1 lead with a power-play goal with 46 seconds remaining in the second period when he sent a wrist shot from the slot past Flyers goalie Ray Emery, and Tampa Bay led the rest of the way.
Lightning goalie Ben Bishop made 24 saves to improve to 6-1-1.
Stamkos scored again early in the third period as a result of some nice playmaking by linemate Valtteri Filppula, who faked a shot and skated behind the Philadelphia net to draw two Flyers defenders. Stamkos, who was left open, ripped a one-timer from the left circle to give Tampa Bay a 3-1 lead.
"I didn't think we had our best game, but we found a way to win," Stamkos said. "That's a good characteristic to have. Special teams played a big part down the stretch. We scored on our chances, and [Bishop] made the saves when he had to. We got into a rhythm for a couple of minutes, and that was huge."
"It's a tough loss, but I thought we had a good third period and I think the game overall was better than the result," Voracek said. "We had some good shifts and skated hard."
The Flyers were called for having too many men on the ice with 5:08 remaining in the game, and the Lightning capitalized, extending their lead to 4-2 when Jason Garrison scored his first goal of the season on a slap shot from the point.
"I saw we had three forwards on the ice and that was a tough one to take," Voracek said. "We got hit with a couple of tough calls, and we can't do anything about it. They have one of the best power plays in the [NHL] and one of the best players in the world. We have to learn from it."
Philadelphia pulled Emery for an extra skater less than a minute after Garrison's goal, his first with the Lightning, and Michael Raffl scored his sixth goal to pull the Flyers to within a goal with 53.5 seconds remaining. It was Raffl's fourth in the past three games.
The Flyers kept the puck in the offensive zone for the rest of the game, but failed to get off a clean shot.
"We kind of inched our way through this one tonight, but they are a very good team," Lightning coach Jon Cooper said. "We kept a lot of excitement in the building, I suppose. Not every game is going to be easy, and sometimes you have to do what it takes to get the win. That's what we did tonight."
Vladislav Namestnikov gave the Lightning a 1-0 at 3:29 of the first period when he redirected a slap shot from defenseman Anton Stralman past Emery for his third goal. Wayne Simmonds tied the score at 1-1 with 7:17 remaining in the first period; it was his sixth.
"I think it's awesome to have all four lines who can contribute, and that's what we were about to do tonight," Namestnikov said. "Hopefully that can continue throughout the season."
Filppula had three assists for the Lightning.
"Our depth showed up again, and from night to night it's going to be different guys that come through," Cooper said. "We generated a lot of chances, but we have to tighten up some things as well."
Emery had 28 saves, but failed to pick up his fourth consecutive win.
"I thought we played pretty well, battled pretty well," Emery said. "You kind of lose momentum when you take penalties. You don't get to go through your whole bench, and the other team is gaining momentum."
The Flyers will travel to face the Florida Panthers on Saturday night, when the Lightning will host the Washington Capitals.