After the Canadiens allowed three consecutive goals -- including two by Sabres co-captain Daniel Briere -- the soft-spoken and rarely quoted Russian forward swept around defenseman Teppo Numminen along the left side before centering to Ryder, who put the puck past Martin Biron into an open right side.
"I just went wide and looked at the net and saw (Ryder) coming, and I just gave it to him and he scored," Perezhogin said. "I feel very good and I like when something like that happens. It's good for me and I think people like it. And it's the winning goal, and it's very nice."
Sabres coach Lindy Ruff found some positives from his team's effort.
"There are a lot of things I liked in the game, the fact that we were able to battle back and the constant pressure that we put on to get points in the game," said Ruff, who will be behind the Eastern Conference bench at Wednesday night's All-Star Game in Dallas with three of his players -- Briere, defenseman Brian Campbell and goalie Ryan Miller -- in the starting lineup.
Briere tied it at 3-3 with his second goal of the game 8:37 into the third.
He got credit for his 18th of the season when Campbell's point shot deflected off his left skate and inside the left post.
"It's frustrating because we didn't quit," Briere said. "We put a lot of effort into it and you come out empty handed, no points like that, but at least we showed a lot of character."
Montreal led 3-0 when Briere scored Buffalo's first goal 9:04 into the second. Derek Roy got his ninth of the season at 16:11 to cut the lead to 3-2.
"They were more rested than us early in the game," said Briere, who had gone six games without a goal, including Friday's 4-3 shootout win over Vancouver. "They came out swinging and all we could do was basically wait for the storm to go by, and by the time it was over it was 3-0 for them."
Guillaume Latendresse and Saku Koivu scored first-period power-play goals to stake the Canadiens to an early 2-0 lead. Montreal increased its lead to three 4:49 into the second when defenseman Francis Bouillon scored an unassisted goal for his second of the season.
Cristobal Huet -- who will make his first All-Star Game appearance Wednesday -- made 24 saves for Montreal, which evened the season series between the Northeast Division rivals.
The Canadiens entered the All-Star break with their second win in a row following three straight losses, including consecutive shutout losses against Detroit and Vancouver.
Biron stopped 27 shots in his first appearance this season against the Canadiens, who have claimed eight of a possible 12 points against Buffalo (3-1-2) despite losing three of their first five games against the Sabres, including both previous meetings at the Bell Centre.
Latendresse, a 19-year-old rookie, scored his 10th goal of the season 8:00 in as Biron and the Sabres caught a bad break during a Montreal power play.
Biron was caught out of position after he went behind the goal to play Tomas Plekanec's dump-in and Latendresse put the puck into a wide open net after it took an unexpected bounce in front from the left corner.
"It took a weird bounce off the metal dasher at the Zamboni door," said Biron, whose lunging attempt to recover was a shade too late. "You get one or two bounces a year like that."
Koivu made it 2-0 with 30 seconds left in the first when he took Alex Kovalev's pass in front and put it over Biron's sprawling attempt into a wide open left side to give the Canadiens their second power-play goal in three opportunities in the opening period.
- Ruff rested Miller, who stopped 28 shots Friday while making his fourth start in a row.
- Montreal's Sheldon Souray will make his second All-Star Game appearance Wednesday as Campbell's starting defensive partner.