Gratton, who also had an assist, was credited with the goal that broke a 1-1 tie at 1:43 of the period when Flyers goaltender Martin Biron's clearing attempt bounced off the right skate of Philadelphia defenceman Randy Jones back into the net.
Ville Peltenon also scored for the Panthers, who have won six of their past seven games.
Dimitry Afanasenkov scored for the Flyers, who have dropped two straight.
Florida goaltender Ed Belfour made 26 saves for his 21st win. His best stop came midway through the second period when he slid across the goalmouth to deny Jeff Carter's point-blank shot. He preserved the lead with a glove save on a hard shot by Simon Gagne with 1:32 left in the third period.
Belfour is 8-2-2 in his past 12 starts.
Biron, making his fourth straight start for the Flyers, stopped 35 shots.
Afanasenkov put the Flyers ahead at 1:55 of the second period with a brilliant move. Skating from behind the net, he scored his ninth goal on a backhanded wraparound shot that sailed past Belfour's glove.
Florida tied it 1:20 later when Peltonen's shot from left of the slot glanced off the far post into the net. It was his 13th goal of the season.
Notes: The Flyers failed on six power-play opportunities and are 2-for-39 in the past nine games. They are 5-for-52 with the man advantage in the 11 games since Peter Forsberg was traded . . . Philadelphia has won only six home games, the fewest in the NHL . . . The Panthers, who finished a two-game road trip, are 8-2-2 in their past 12 games . . . Philadelphia RW Scottie Upshall and D Lasse Kukkonen hit the post in the second period.