Tyler Johnson had the other goal for Tampa Bay, which moved within a point of Montreal for second place in the Atlantic Division.
Anders Lindback played in place of injured Tampa Bay starting goalie Ben Bishop, who may not be ready for the start of a playoff series next week against Montreal due to an upper-body. Bishop, 37-14-7 this season, left Tuesday night's game against Toronto early in the first period after it appeared he hurt his left elbow.
Panik won a race for the puck behind the net, moved out front and gave Tampa Bay a 2-1 lead on a back-hand rebound of his own shot 4:33 into the third. It stopped the right wing's 17-game goal drought.
Brewer extended the advantage to 3-1 when he beat Ray Emery from the left circle at 9:43 of the third.
After the Flyers pulled within one when Tampa Bay's Ondrej Palat deflected Couturier's pass past Lindback at 12:22, Stamkos' power-play goal made it 4-2 with 5:46 remaining.
Stamkos setup Johnson's goal from the left circle 2 minutes into the game. Johnson set a team rookie record, breaking the mark set by Stamkos, with his 24th goal this season.
Simmonds tied it at 1 on an in-close turnaround goal during a power play with 1:21 to go in the second. The Flyers entered with the NHL's top-ranked road power play.
Emery turned aside two good scoring chances by both Stamkos and Ryan Callahan during a second-period Tampa Bay power play.
Notes: Tampa Bay D Michael Kostka returned and had two assists after missing three games with a concussion. ... The Flyers have lost six straight road games against Tampa Bay. ... Lightning D Sami Salo sat out with an undisclosed upper-body injury.