Ryan Miller made 40 saves, including Marco Sturm's penalty shot in the first period, in a matchup of last month's USA Olympic goaltenders.
Boston goalie Tim Thomas, Miller's backup in Vancouver, was pulled following the Sabres' third goal and left the ice to jeers. He was making his second straight start after shutting out Calgary on Saturday.
Tim Kennedy also scored for Buffalo, which moved one point behind Pittsburgh for second overall in the Eastern Conference.
David Krejci and Dennis Seidenberg scored Boston's goals. The Bruins, who remained in eighth place in the East after Carolina defeated Atlanta 4-1, lost for the third time seven games.
The Sabres improved to 27-0-0 when leading after two periods, but had to hold on after Seidenberg scored to make it 3-2 with 5:37 to play.
Miller stopped Mark Recchi's shot from in close as the horn sounded.
The Bruins grabbed a 1-0 lead when Krejci made a nifty move by faking to go behind the net from the right side before tucking a shot inside the post, beating Miller at 7:43 of the first.
Myers' goal tied it 2:13 later. He stole a clearing pass at the right point and fired a high shot that hit defenseman Dennis Wideman's arm and caromed by Thomas.
The Sabres made it 2-1 when Gaustad scored on a backhand from in close off a rebound midway into the opening period.
The Bruins, who had a big edge early in the first period with strong play and some good scoring chances, ended up outshooting Buffalo just 14-11 in the period.
Miller blocked Sturm's penalty shot when the winger shot it into his body at 3:20 of the first.
Kennedy completed a 2-on-1 break when he slipped a shot under Thomas' left pad 6:08 into the second period.
When Thomas was lifted in favor of Tuukka Rask, he headed down the runway toward the dressing room and missed about six minutes of play.
Seidenberg's shot from the left wing hit Miller, popped over his left shoulder and rolled into the net.
Notes: It was the sixth time this season Thomas has been pulled from a game. Rask has never been removed. ... Buffalo's Derek Roy was held scoreless after getting a hat trick in a win over Tampa Bay on Saturday. ... The Bruins dropped to 3-10-3 at home since New Year's Day. ... Thomas Vanek, Tim Connolly and Patrick Kaleta missed the game with injuries.