The win came a week to the day after a 6-0 whitewashing by Toronto at the Bell Centre.
Defenseman Josh Gorges said the club did right to forget that defeat and focus on the games ahead.
"I thought the way we handled that game, with (Erik) Cole getting the guys together, guys talking and coming back to work the right way. ... You can lick your wounds and feel sorry for yourselves and point fingers, but instead of doing that we decided to look in the mirror, and be accountable and get better," Gorges said. "We had a good week."
The Canadiens rebounded with a 4-3 shootout win at Tampa Bay on Tuesday night and a 1-0 overtime win over the Panthers in Florida on Thursday before putting away Philadelphia.
"It was important to bounce back," coach Michel Therrien said. "We got better each game. I like how we competed. I couldn't ask for more."
David Desharnais and Tomas Plekanec also scored for the Canadiens, while backup Peter Budaj got his first win in three starts this season while filling in for Carey Price, who was at home sick. Max Pacioretty and Brian Gionta each had a pair of assists.
Daniel Briere had the lone goal for the Flyers, who have lost three of their last four and looked tired and listless as they were outshot 29-19. The Flyers had only seven shots when Briere scored more than halfway through the second period.
Captain Claude Giroux's concern with his team's flat play was evident when he spoke after the game.
"There's no compete," he said. "We're not winning battles.
"We're just going through the motions. You know, we're a young team that can skate. We should be winning more battles than this. It's just frustrating to see. I know I have to be better, but a team is 20 guys and you need everybody to show up."
"Sometimes there are games where you go out there and see how it plays out," Boucher said. "You don't want to play the game that way. You want to be on the attack, on the balls of your feet. Maybe that was the case tonight."
It may have been a costly win for Montreal, which has been healthy since the start of the season except for center Petteri Nokelainen's back injury.
Gallagher left four minutes into the third period after he was checked into the boards by Luke Schenn, and Pacioretty exited the game after crashing either an elbow or his ribs into a goalpost after being hauled down by Kimmo Timonen at 11:52.
Therrien said both players had upper body injuries and would undergo tests to determine the extent of the problems.
Later, forward Colby Armstrong took a puck to face and went for treatment. And then defenseman Alexei Emelin struggled to the bench after being checked from behind by Giroux, although he stayed in the game.
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 Boucher kept them in the game.
Gallagher got his fifth of the season at 8:53 after taking a feed from Pacioretty and putting a nifty move on Timonen before scoring on a low shot.
Gallagher and Pacioretty combined again to feed Desharnais alone in front 1:15 into the second frame.
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 sprawled Boucher.
Bourque was credited with an empty-net goal at 18:56.
Goalie Robert Mayer was called up from AHL Hamilton to back up Budaj. ... Montreal defenseman Emelin, hit on the face by a puck in the preseason, has traded in his face cage for a visor. ... Ryan White, Yannick Weber and Tomas Kaberle were scratched for Montreal. The Flyers sat out Kurtis Foster, Herry Zolnierczyk and Tom Sestito.