The Flyers, who opened an eight-game trip, trailed twice in the first period but found a way to win their sixth road game of the season.
It was the first time this season after 14 consecutive victories the Maple Leafs lost when opening the scoring. Their five-game home winning streak also came to an end.
Toronto (19-11-3) has lost two in a row and will play at the Chicago Blackhawks on Sunday in the first of seven straight road games.
Philadelphia (12-14-6) plays at the Winnipeg Jets on Sunday.
The Flyers were without No. 1 goalie Steve Mason, who was injured at practice Friday. It is suspected Mason has back spasms, and general manager Ron Hextall said he would not be available for the weekend. He will be re-evaluated by the Flyers' medical staff Monday. Ray Emery started and made 21 saves.
"It wasn't the ideal start for the team or myself, but I'll take an ugly win anytime," Emery said. "I thought the team played great. We didn't get rattled being down early and we came back and just kept putting pressure on them while playing well defensively at the same time. I wasn't particularly happy with my game, but a win is a win."
The Maple Leafs employed some precise passing to take a 1-0 lead at 4:51 of the first period. Phil Kessel skated out of the Toronto zone along the left-wing boards and passed cross-ice to defenseman Morgan Rielly, who joined the rush. Rielly then spotted left wing Joffrey Lupul, playing his 200th game with the Maple Leafs, in front of the net and made a perfect backhand pass. Lupul put a shot in under the crossbar.
The Maple Leafs went up 2-0 at 5:40 with a power-play goal 28 seconds after Flyers center Scott Laughton was penalized for unsportsmanlike conduct. Left wing James van Riemsdyk tipped home a low Cody Franson shot for his 14th goal of the season.
R.J. Umberger got the Flyers back in the game with his third goal of the season at 8:14. Toronto goalie Jonathan Bernier made the initial save on Sean Couturier, but the rebound went directly to Umberger in the slot, where he scored with a wrist shot.
Couturier tied it 2-2 at 11:18 with his eighth of the season when he was set up alone in the slot, but the Maple Leafs restored the lead on the next shift when David Clarkson's 30-foot wrist shot found its way through a crowd and into the net on Emery's glove side at 11:33.
Maple Leafs defenseman Stephane Robidas got his 200th NHL assist on the goal.
Giroux tied it 3-3 11 seconds later with his ninth goal of the season when he charged to the net with Maple Leafs center Nazem Kadri covering him and tipped a Voracek shot past Bernier.
The three goals in 26 seconds established a Maple Leafs record for the fastest three goals scored in a game. The six goals were scored in 6:53.
The Flyers took their first lead at 3:52 on a wonderful play by defenseman Nicklas Grossmann. Standing at the left point with the puck and no direct path to the net, Grossmann purposely shot wide at the backboards to create a rebound. The puck hit the boards, bounced off the back of Bernier's legs and trickled into the net. It was Grossmann's third goal of the season.
Giroux made it 5-3 at 16:03 when he took a pass at the side of the net and from a sharp angle managed to beat Bernier with a shot to the short side.
The Flyers went up 6-3 during a 4-on-4 situation when Scott Laughton scored his second of the season at 5:47 on a pass from Voracek, who collected his fourth point of the game. Then, at 9:32, Michael Raffl scored his ninth of the season from the slot.
The Maple Leafs replaced Bernier with James Reimer after Philadelphia's seventh goal. Toronto's Peter Holland slipped past defenseman Mark Streit and scored his eighth goal of the season to make it 7-4 at 13:49.
"It was important that we didn't panic after going down 2-0 and we just stuck with our game plan," Voracek said. "We skated very well today. We were attacking and back-checking. We had 42 shots and on the road that is pretty tough to do. It was our best road game of the year and maybe even our best game overall."
Toronto coach Randy Carlyle liked the start, but felt the Maple Leafs got away from their game plan in the final 50 minutes.
"Our execution level as a group was way down," Carlyle said. "I remember three or four opportunities to make a breakout pass and we put it in people's feet or iced the puck by leading them too much. It was like the execution of the simplest things was a challenge for us after 10 minutes."