Gagne had chances on a wraparound and a shot in close before beating Martin Brodeur with a shot from between the circles to give the Flyers a sweep of the home-and-home series.
Travis Zajac and Rob Niedermayer scores for the Devils, while Brodeur made 13 saves.
With both teams already in Newark, a winter storm that dumped a least a foot of snow could not prevent the game from going on, attracting an announced crowd of 5,580 that looked smaller.
Some fans were angry that the Devils played the game in the first place, instead of refunding tickets for those who couldn't make the wintry trek.
"The New Jersey devils have no regards for the fans or fan safety," ticket-holder Jen Caruso wrote in an email to NBCNewYork. "They are saying the game is being played so you should get here or lose the $$ as there will be no refund or exchanges."
So perhaps it was karma when for the second time in three nights in the home-and-home series, the Devils took a 2-0 lead only to see the Flyers come back to tie the game entering the third period.
Zajac and Niedermayer put New Jersey ahead with somewhat flukey goals in the opening 8:01 only to see Asham and Carter tie the game with goals in the first and second periods.
Leighton gave Zajac a gift 18th goal of the season 45 seconds after the opening faceoff when he let a routine shot from the top of the left circle dribble through his pads and rolls ever-so-slowly into the net.
Niedermayer threw a pass in front from along the goal line at the 8-minute mark and the puck hit off Leighton, deflected into the skates of Flyers defenseman Kimmo Timonen and into the net.
Asham, a former Devil, got the Flyers on the board less than a minute later when his shot from the right faceoff circle deflected off New Jersey defenseman Andy Greene and zipped past Brodeur.
Scott Hartnell nearly tied it with 5 minutes left in the first period, but Brodeur made a diving glove save on the goaline to prevent his tap-in from going into the net. The play was reviewed and videotape didn't help Hartnell.
Carter, whose hit on Anssi Salmela on Monday gave the Devils' defenseman a concussion, tied the game with about 6 minutes left in the second period. Danny Briere sent a cross-ice pass entering the Devils zone and Carter got his 24th of the season with a shot from the left circle.
Devils and U.S. Olympic forward Zach Parise missed his first game of the season with an undisclosed upper-body injury.
NOTES: The presentation of colors by the Marines was delayed about a minute because the tip of the pole bearing the U.S. flag got caught up in the netting used to protect fans from errant shots. ... Devils defenseman Bryce Salvador appeared to be hit in the face in the first period. He did not return. The team said it was an upper-body injury. ... Claude Giroux assisted on Asham's goal. He has one goal and six assists in six career games against the Devils.