Monahan took a pass from Johnny Gaudreau in the slot and lifted a shot over Lehner's blocker for the winner.
"I just tried to get open," Monahan said. "Johnny had the puck. When he has the puck you try to find a soft spot. He threw a saucer on my stick. It was a great play there by Johnny."
The win was Glen Gulutzan's first with the Flames. He was hired June 17 to replace Bob Hartley.
"I was more excited for the guys," Gulutzan said. "You get to be around your team for a month here and we've got a great group and they're trying. They're really putting it out there. They're squeezing a little bit. To get that off them, I think, will move us forward. So we needed it and they needed it."
Girgensons scored 7:25 into the first period, and Frolik tied the game at 16:12.
O'Reilly put the Sabres up 2-1 with a power-play goal at 11:41. Johnson stopped his one-timer, but the rebound ricocheted off Flames defenseman Dougie Hamilton and into the net.
Ferland tied the game 2-2 at 1:10 of the third, and Foligno restored Buffalo's one-goal lead with a shot over Johnson's glove at 3:49. But Tkachuk tied the game 3-3 with his first NHL goal at 4:52.
"Obviously unbelievable," said Tkachuk, the No. 6 pick in the 2016 NHL Draft. "You dream about scoring in the NHL for a long time. Now that I've got the first one out of the way, hopefully we can just keep rolling as a team and keep putting the puck in the back of the net like we did tonight."