Tyler Toffoli scored his 25th goal of the season, and Jake Allen made 21 saves for the Canadiens (21-17-9), who won the finale of the three-game set after losing the first two.
"It's big," Montreal captain Shea Weber said. "Obviously [we] haven't had much success against them the past two weeks, but there's still a lot of work left to do. That was a step in the right direction. [It] gives us a little bit more breathing room. Definitely have to keep going."
Elias Lindholm scored, and Jacob Markstrom made 22 saves for the Flames (21-24-3), who are fifth in the seven-team North. The top four teams will qualify for the Stanley Cup Playoffs.
"There's no question we all want it," Markstrom said. "We all want it bad. It's such small coincidences and small margins from being really successful. I feel like we've been on the wrong side of that way too many times this season.
"Overall this season I feel like we've been on the wrong end, but the belief is there. The guys want it. The guys are [ticked] off. We don't like to lose."
Toffoli gave the Canadiens a 2-1 lead at 18:05 of the second period with a one-timer from the right face-off circle off a pass from Joel Armia.
Toffoli has scored in four straight games and six of seven. His goal streak matches his NHL career high set with the Los Angeles Kings from Oct. 16-23, 2015.
"I think we're all kind of expecting to score the big goals, and that's what everybody wants to do," Toffoli said. "Things have just been going my way right now. I know other guys that are just waiting to step up and having some really good opportunities and some good looks. We're pushing it and we're trying to find ways here."
Weber one-timed Tomas Tatar's pass over Markstrom's shoulder on a 5-on-3 power play to give Montreal a 1-0 lead at 9:59 of the first period.
Lindholm tied it 1-1 on the power play at 12:17 following a cross-ice pass from Johnny Gaudreau. It was his 15th goal of the season.
"We needed this win," Lindholm said. "We put [ourselves] in a tough position here, but as long as there's hope we've got to keep pushing and keep grinding. Obviously, it [stinks]. We'd like to have this one back."