Stafford scored when his wrist shot bounced off goalie Tomas Vokoun's blocker high into the air, then fell in behind Vokoun. Buffalo's Daniel Paille looked as though he might have tipped the puck, but the goal was awarded after video review.
Ales Kotalik, Jochen Hecht and Paille also scored for the Sabres in their first victory on the road after an 0-3 start. Jason Pominville had two assists.
Jozef Stumpel and Ville Peltonen scored for the Panthers, who lost at home for the second time in five games.
Ryan Miller stopped 33 shots for Buffalo, including a big pad save on a tip-in by Olli Jokinen with a little over 5 minutes left.
Vokoun made 29 saves.