Gagne gave the Flyers a 1-0 lead on a one-timer late in the first period, before Maroon assisted on Jared Ross' power-play goal in the second to tie the score.
Maroon then knocked a loose puck past Jean-Sebastien Aubin midway through the third period to put the Phantoms ahead before Jonathan Matsumoto made it 3-1.
Upshall cut the deficit to one less than a minute later, but the Phantoms held on.
The Flyers had a goal disallowed with 43.8 seconds left after Jeff Carter used his glove hand to put the puck in the net.
It was the second exhibition game the Flyers played this preseason at the Wachovia Spectrum, their original home. The team moved to the Wachovia Center in 1996, with the Phantoms taking over as the hockey tenant in the Spectrum. The building is scheduled to be razed sometime after the conclusion of the upcoming 2008-09 season.
The Flyers open the regular season Saturday when they host the New York Rangers.