Montreal took control of the game with three goals in the second period, starting with Gallagher's goal at 4:48 to make it 2-1. The forward got into the slot and had Logan Mailloux's shot deflect off his knee and past Kolosov.
After Caufield's power-play goal made it 3-1 at 12:48, Gallagher had his stick break on an attempted dump-in from the right point. The puck instead rolled to an open Jake Evans along the goal line on the left side, and he scored to put the Canadiens ahead 4-1 at 16:01.
The points were Gallagher's first in seven games.
"Take them when you can get them," he said. "The League's hard enough, so when you get breaks like that, you take them.
"You look at the stat sheet, end up with two, probably wasn't one of my better games. But throughout the year I've felt pretty good, so it's nice to get rewarded. Just kind of move on and hopefully continue to roll."
Gallagher's teammates were happy to see the 32-year-old rewarded for his dependable hard work.
"Sometimes it's easy to focus in on points, but I'd say, especially a guy like that, he has so much more to bring to the table to help the team win," Matheson said. "And sometimes a puck goes in off your knee, and you break a stick, and it goes to a guy back door. Sometimes those sorts of things happen, and usually they do when you've been doing a lot of other things well."
Suzuki made it 1-0 at 10:42 of the first period when he lifted the puck over Kolosov from the crease, but Sanheim tied it 1-1 at 17:24 with a shot from the top of the offensive zone.
After Montreal's big second period, Sanheim and Konecny scored 29 seconds apart to get the Flyers within 4-3 late in the third period.