Starting in place of Robin Lehner, Nilsson made 18 saves in the first period.
"He had a couple of really big saves, but I thought he was at his best really being solid in net, real calm, and didn't seem to get flustered when the puck was lying in the blue paint," Sabres coach Dan Bylsma said. "You may need a performance like that to get a win against Pittsburgh and he gave it to us."
WATCH: All Penguins vs. Sabres highlihts
O'Reilly, who was recalled from the American Hockey League on Saturday, beat Penguins goalie Marc-Andre Fleury with a wrist shot to the high corner. He's 6-for-13 in NHL shootouts.
"Cal has experience against Marc-Andre in a shootout and Cal's good in a shootout," Bylsma said. "One of his go-to moves is that one. I don't know how he scored against Marc-Andre in 2010 (as a member of the Nashville Predators), but ... you want to put people in the right spots to have success. And regardless of whether Cal's a call-up or not, I think that was the right time for Cal, and he came through."
The Penguins (11-4-3) have lost two of the past three and three of five.
Captain Sidney Crosby made it 1-1 with a power-play goal 5:46 into the third period. Crosby received a pass from Chris Kunitz across the crease and shot the puck past Nilsson for his 12th goal of the season. He is tied for the NHL lead with Patrik Laine of the Winnipeg Jets.
It was the first goal Crosby scored against the Sabres since Feb. 5, 2014. He has 15 goals and 35 assists in 32 games against Buffalo.
"It's just one of those games where you leave feeling like you deserve better," Crosby said. "Ultimately we have to find a way to bury a few chances, but I thought we created a number of them, especially in the third."
William Carrier's first NHL goal, in his eighth game, gave the Sabres a 1-0 lead 8:16 into the first period.
"It's great for him, he deserved it," O'Reilly said. "He's playing great up here and I knew when he came up his work ethic and tenacity how he plays the game, they love him and he's doing great. It's great to see him get rewarded."