Carter scored his 25th and 26th goals and Michael Leighton made 31 saves in the Flyers' 3-2 victory Friday night.
The teams will play again Saturday night in Montreal before the Olympic break.
"You want to go into the break feeling good about yourselves and playing your best hockey," Flyers defenseman Chris Pronger said. "We were able to gut it out tonight."
After Carter scored late in the first period and early in the second, Matt Carle made it 3-0 at 3:17 of the second. Carle's shot from the blue line deflected off Montreal defenseman Ryan O'Byrne and past goalie Carey Price.
Montreal's Glen Metropolit and Dominic Moore made it close, scoring in a 56-second span early in the third period. Metropolit gave his team some momentum when his centering pass went off Danny Briere and past Leighton.
Moore then corralled a rebound off a shot from Roman Hamrlik, prompting Flyers coach Peter Laviolette to call a timeout.
"Those guys were gassed," Laviolette said. "We had a tough bounce on that first goal and they gained some momentum from it. Then they ran around for about three, four shifts in a row. During that timeout, we had to get back and keep the game simple, without turning it over."
Leighton and the defense shut down the Canadiens the rest of the way, including killing off a Montreal power play during the final 58 seconds.
"Obviously we wanted to win that 3-0," Leighton said. "Fortunately it [ended] 3-2, but we did really well the last minute, the last five minutes, really. We didn't give them much. We battled pretty hard and played well defensively."
"We came back in the third, but it was one of those games where we just ran out of time," Moore said.
The Flyers are playing crisply heading to the break, after scoring one goal combined in losses at Minnesota and Edmonton. They rebounded by roaring back from two-goal deficits in consecutive nights against Martin Brodeur and the New Jersey Devils before storming to a lead against the Canadiens.
Philadelphia has won nine of its past 11 home game, beating Montreal at home for the first time since March 6, 2006. The Flyers passed Montreal in the standings and sit as the sixth seed with 23 games left.
"It's sink or swim right now," Laviolette said. "You're either going to continue to hold your ground, move up or go backward with not much time left. If you go backwards, it's going to be really difficult to take steps forward. Everybody's getting points every night so it's important to make sure you get as many points as you can. We have one big game left, and it's big for the Canadiens, so there's a great sense of urgency. They are desperate to make the playoffs as well, so we need to be ready."
Canadiens defenseman P.K. Subban made his NHL debut after Andrei Markov was a late scratch. The 20-year-old Subban was a second-round pick in 2007 and a two-time gold medal winner with Canada in the World Junior Championships. ... Carter has scored at least one goal in three straight games. ... The game ended with some pushing and shoving led by Montreal's Scott Gomez and Philadelphia's Kimmo Timonen, who was slapped with a 10-minute misconduct penalty.