OTTAWA -- Matt Moulson and Justin Bailey scored in the third period, and Robin Lehner made 39 saves to help the Buffalo Sabres to a 3-2 win against the Ottawa Senators at Canadian Tire Centre on Tuesday.
Ryan O'Reilly also scored for Buffalo (24-23-10), which finished the season series 4-0-1 against the Senators.
"Our talk was coming out in the third was a situation where we thought we knew we could come back and we had proven we can come back," Sabres coach Dan Bylsma said.
WATCH: All Sabres vs. Senators highlights
Bobby Ryan had a goal and an assist and Dion Phaneuf scored for Ottawa (29-19-6). Craig Anderson made 22 saves in his second start since returning from personal leave to be with his wife, Nicholle, while she had cancer treatment.
It was the seventh time this season the Sabres rallied when trailing after two periods, tied for the most in the NHL this season with the Montreal Canadiens and the Pittsburgh Penguins. The Sabres are five points back of the second wild card into the Stanley Cup Playoffs from the Eastern Conference.
Video: BUF@OTT: Ryan deflects Karlsson's shot five-hole
Bailey put the Sabres ahead 3-2 at 7:38 of the third period.
"We came in after the second and we weren't discouraged," said Bailey, who scored his second goal of the season in his 16th game. "We knew the game was right there. We were doing a lot of good things all night. We just stuck to our game plan."
Moulson tied the game 51 seconds into the third period. Sam Reinhart jumped on a loose puck by the left post and it bounced up in the air to Anderson's left, where Moulson got his stick on it for his 12th goal of the season to make it 2-2.
O'Reilly opened the scoring 24 seconds into the game off the rush when he took a pass from Kyle Okposo near the top of the right wing circle and scored his 12th goal of the season.
Video: BUF@OTT: Anderson extends a pad to rob O'Reilly
Ryan tied it at 14:45 of the first period when he got his stick on a soft wrist shot by Senators defenseman Erik Karlsson in the slot. Ryan tipped the puck down and past Lehner for his 12th goal of the season.
Phaneuf gave the Senators a 2-1 lead after two periods when he scored his eighth of the season at 14:33.
"I thought we deserved a better fate tonight," Ryan said. "I thought the effort was there. We did a lot of good things. I think the one fault is [Lehner] saw too many pucks. He made a lot of good saves."
Video: BUF@OTT: Moulson knocks puck in out of midair
Goal of the game
Phaneuf gave the Senators a 2-1 lead in the second period when he rushed the puck up the center of the ice. After passing the puck to Ryan on the left wing, Phaneuf went to the net and knocked in the rebound of Ryan's shot.
Video: BUF@OTT: Phaneuf finishes rush by poking home rebound
Save of the game
With the Sabres up 1-0, Lehner came up with a save on a quick shot from the slot by Senators forward Mike Hoffman at 6:11 of the first period.
Video: BUF@OTT: Lehner closes the pads to shut down Hoffman
Highlight of the game
After the Sabres battled back to tie the game, Bailey went to the net and scored the winning goal by deflecting Jake McCabe's shot with the shaft of his stick.
Video: BUF@OTT: Bailey deflects home go-ahead goal in 3rd
Unsung performance of the game
Justin Falk had an assist, led the Sabres with five hits and four blocked shots, and also won a faceoff.
Video: BUF@OTT: O'Reilly nets one-timer 24 seconds into game
They said it
"You could question me. At some [point] in time, I'm probably going to do it and you're going to stick that mic in my face again and ask what the heck are you doing not playing Robin Lehner against the Senators? But I don't see it happening." -- Sabres coach Dan Bylsma after goalie Robin Lehner improved to 4-0-2 against the Senators
"We just want to keep winning. We're going to go to a game-by-game mindset now and not look at the future. We have three games before [our] break, take those one at a time, try to set ourselves up, have a bye week and gather some strength and one back for a last push. This means nothing." -- Sabres goaltender Robin Lehner
"You've got to give the opponent credit for what they do also. You're not alone on that ice surface. They capitalized on their chances and we didn't capitalize on some of the chances that would have made a difference." -- Senators coach Guy Boucher
Need to know
Sabres forward Evander Kane missed the game because of an illness. … Senators forward Curtis Lazar was a healthy scratch for the fourth game in a row. ... Hoffman led the Senators with seven shots on goal.
Sabres: Host the Colorado Avalanche on Thursday (7:30 p.m. ET; NBCSN, NHL.TV)
Senators: At New Jersey Devils on Thursday (7 p.m. ET; MSG+, TSN5, RDS, NHL.TV)
Video: Bailey's goal helps Sabres to 3-2 comeback win