Updated

Bryan Flynn and the lowly Buffalo Sabres found a way to earn two more points at the Montreal Canadiens' expense.

Flynn scored in regulation and added the shootout winner in the Sabres' 4-3 victory Saturday night.

Flynn beat Dustin Tokarski with a few nifty moves before slotting home the winner on his forehand. After losing five straight, Buffalo has won five of its last six games.

Former Canadiens captain Brian Gionta got the primary assist on Flynn's tying goal.

"We had the lead, we gave it away, but we stuck with it," said Gionta, who was met with a thundering cheer from the crowd during the singing of the national anthems. "It shows the maturity that the team is coming into in the way we're playing the game and the way we stick with things. The result that we had in the third period is something to look at and continue to grow off of."

Zemgus Girgensons and Chris Stewart also scored and Jhonas Enroth stopped 41 shots to help Buffalo sweep the home-and-home series. On Friday night in Buffalo, the Sabres beat the Canadiens 2-1.

"We spent three-quarters of the game in the offensive zone without being able to capitalize more than we did," Montreal coach Michel Therrien said. "The way we played, we could have picked up four points this weekend. So it's definitely disappointing when you only get one point."

Brendan Gallagher, Lars Eller and Max Pacioretty scored for Montreal. Tokarski made 23 saves.

Buffalo opened the score with 5:57 left in the first period. After Tokarski stopped Tyler Ennis' shot, Montreal's David Desharnais failed to clear the rebound, shooting the puck right off Girgensons and into the back of the net.

The goal was Girgensons' seventh of the season. The 20-year-old scored eight times in 70 games as a rookie last season.

The Canadiens finally beat Enroth at 7:51 of the second. Gallagher, who signed a six-year contract extension earlier in the day, celebrated with his sixth goal of the season to tie it at 1.

Stewart restored Buffalo's one-goal lead at 5:57 of the third period, beating Tokarski on a breakaway while being pestered by defensemen Mike Weaver and Bryan Allen. The play started with a huge shot block by Marcus Foligno in the defensive zone.

The Canadiens answered back 1:34 later when Eller's shot toward Enroth went off the skate of Sabres defenseman Nikita Zadorov.

The teams then scored 49 seconds apart, with Flynn tying it with 5:56 left after Pacioretty gave the Habs a 3-2 lead with 6:45 to go.

Former Canadiens captain Brian Gionta got the primary assist on Flynn's tying goal.

"We had the lead, we gave it away, but we stuck with it," said Gionta, who was met with a thundering cheer from the crowd during the singing of the national anthems. "It shows the maturity that the team is coming into in the way we're playing the game and the way we stick with things.

"The result that we had in the third period is something to look at and continue to grow off of."

Notes: Former Montreal defenseman Josh Gorges, traded to the Sabres in the offseason, missed the game because of a knee injury. ... Montreal defenseman Tom Gilbert was a healthy scratch for the second game in a row.