York scored the go-ahead goal 2:24 into the third period, less than a minute after Gagne tied it off an assist from Peter Forsberg.
York's goal was the subject of a lengthy review while officials confirmed his stick wasn't too high when he took an awkward bunt-like swing, hitting the puck off the shaft of his stick into the net.
Jeff Carter's short-handed goal on a breakaway with about 6 minutes left pushed the lead to 4-2. With 1:04 left and Atlanta goalie Kari Lehtonen watching from the bench, Alexei Zhitnik added an empty-net goal.
Antero Nittymaki stopped 32 shots, allowing only one goal, to move to 6-0 against Atlanta with his second win over the Thrashers in a week. Nittymaki led the Flyers to a 2-1 win in Atlanta last Sunday.
Flyers coach John Stevens opened the game with Robert Esche in net - but only for a few minutes while Nittymaki worked out a stiff neck.
Carter's goal came less than 30 seconds after Forsberg's slashing penalty. The Thrashers couldn't score with the man advantage, leaving them without a power-play goal in six of their last seven games. They were 0-for-4 on the power play in the game.
Philadelphia, last in the NHL with 33 points, moved to 8-0-1 against Atlanta since its last loss to the Thrashers on Dec. 21, 2003.
The Flyers took a 1-0 lead only 2:41 into the game when Dimitry Afanasenkov took advantage of the opening left when Lehtonen was slow recovering after leaving the net. Afanasenkov took a pass from Todd Fedoruk and scored from the high slot - his second goal in two games.
Esche faced only five shots, allowing Ilya Kovalchuk's breakaway goal 3:36 into the game, before he was lifted for Nittymaki 6:59 into the game with the score 1-1.
Jim Slater gave Atlanta a 2-1 lead 3:37 into the second period with his fifth goal, but Nittymaki shut out the Thrashers the rest of the way.
Notes: RW Darren Haydar, signed from AHL Chicago on Friday when J.P. Vigier was placed on injured reserve with a groin injury, saw his first playing time for Atlanta. Haydar was leading the AHL with 89 points. ... Kovalchuk's goal was his 30th of the season. ... The Thrashers drew only one penalty, a hooking minor on Shane Hnidy 15:48 into the second period. ... The game was Atlanta's sixth sellout of the season.