Guillaume Latendresse, Saku Koivu and Francis Bouillon also scored for the Canadiens (27-17-5), who improved their record in January to 5-6-0 heading into this week's all-star break.
Daniel Briere had two and Derek Roy also scored for the first-place Sabres (33-12-4), who have won only two of their last six games.
The Canadiens improved to 3-1-2 on the season against Buffalo.
All-star Cristobal Huet made 24 saves for the Canadiens, while Martin Biron started in place of Sabres all-star netminder Ryan Miller and made 27 saves to lose his second straight start.
Both teams have probably been looking forward to the all-star break for a little while with exhausting schedules of late. Saturday's game was Buffalo's seventh in the last 11 nights, and it was Montreal's fourth in the last six nights.
With the Canadiens ahead 3-2 near the midway point of the third, Briere struck with his second of the game and 18th of the season on a nifty give-and-go play with Brian Campbell to tie it up at three at 8:37 and complete a three-goal comeback for the Sabres.
After the Sabres killed off a late power play, Montreal's Ryder struck at 17:07 of the third to give the Canadiens the win. Alexander Perezhogin flew down the left wing and slid a pass across to a streaking Ryder, who made no mistake for his 15th of the season, sending the sellout Bell Centre crowd of 21,273 into a frenzy.
Montreal took advantage of two lucky bounces off the end boards to score two first period power play goals.
A Tomas Plekanec dump-in drew Biron out of his net, but the puck took a funny bounce out in front to Latendresse who tapped it into the empty net for the rookie's 10th at 8:00 of the first.
The Canadiens went up 2-0 at 19:30 of the first when Andrei Markov's shot bounced off the end boards to Alexei Kovalev, who found Koivu in front for his 16th of the year.
Montreal pushed the lead to 3-0 on Bouillon's second of the year at 4:49 of the second, but Buffalo scored two before the second intermission to cut the Canadiens lead to one.
Briere was left wide open for an easy goal at 9:04 of the second after Montreal winger Guillaume Latendresse collided with defenceman Mike Komisarek in the Canadiens zone.
Roy made it 3-2 with his ninth of the year at 16:11 when his shot from the circle went in off Montreal defenceman Craig Rivet's skate.
Notes: Sabres D Henrik Tallinder missed his ninth game with a sprained ankle, while winger Jochen Hecht missed his third game with a lower body injury.aMontreal D Janne Niinimaa and wingers Garth Murray and Aaron Downey were healthy scratchesaWingers Jiri Novotny and Andrew Peters were healthy scratches for the SabresaThe game featured both Eastern Conference starters on defence in Wednesday's NHL All-Star Game, Buffalo's Brian Campbell and Montreal's Sheldon Souray.