David Desharnais, Tomas Plekanec and Rene Bourque also scored for the Canadiens, who outshot the tired-looking Flyers 29-19.
Gallagher left four minutes into the third period after being hit into the boards by Luke Schenn and did not return. There was no immediate word on the injury.
Daniel Briere scored for Philadelphia, which has lost three of its last four games.
The Flyers were coming off a 5-3 loss to New Jersey on Friday night. They were outshot 12-2 in the opening period but goalie Brian Boucher, filling in for Ilya Bryzgalov, kept them in the game.
Gallagher got his fifth of the season at 8:53 after taking a feed from Max Pacioretty and putting a nifty move on Kimmo Timonen before scoring on a low shot.
Gallagher and Pacioretty combined again to feed Desharnais alone in front 1:15 into the second frame.
Defenseman P.K. Subban made a sprawling save after goalie Peter Budaj misplayed a puck behind his crease, but the shutout was broken moments later when Briere put a shot in off Andrei Markov's leg at 13:56.
Budaj got his third start with Carey Price at home battling a virus, and picked up his first win.
Plekanec got his seventh of the season 4:32 into the third as he took his own rebound off defenseman Braydon Coburn and fired it past the sprawling Boucher.
Pacioretty also went for treatment after he appeared to bang an elbow on the goalpost on a drive to the net at 11:52 of the third.
Bourque was credited with an empty-net goal at 18:56.