Paul Gaustad scored the go-ahead goal early in 1.
Buffalo forward Tyler Ennis returned to the lineup after missing 17 games with an ankle injury. He had two shots in about 19 minutes of ice time.
Ryan Miller made 27 saves en route to tying Dominik Hasek's franchise record of 234 wins.
Max Pacioretty scored the lone goal for the Canadiens, who had a two-game winning streak snapped. Carey Price stopped 37-of-39 shots.