Jonathan Huberdeau scored his 20th goal of the season 33 seconds into the third to make it 4-1.
Barkov got Florida within 4-2 at 4:56 with his 152nd NHL goal, tying Pavel Bure for third in Panthers history behind Scott Mellanby (157) and Olli Jokinen (188).
Sean Couturier made it 5-2 at 14:52 before Robert Hagg scored a power-play goal with 28 seconds left for the 6-2 final.
"I figured with that skill level, [the Panthers] would have a strong push, and they did," Flyers coach Alain Vigneault said. "We made a mistake on the first goal. They got a bounce on the second goal. As players and a team, you've just got to play. And that's what we did. They kept playing, kept making better plays from that moment on, and they would be pressing, [Couturier] caught them there and was able to score that big goal."
The Flyers defeated the Panthers 4-1 in Philadelphia on Monday before losing 5-3 at the New York Islanders on Tuesday, when Florida defeated the New Jersey Devils 5-3.