Ales Kotalik and Derek Roy also scored as the Sabres rallied from a 2-0 first-period deficit in their final home regular-season game. It was a big night for goaltender Ryan Miller, who earned his club-record 39th victory, breaking the mark of 38 set by Don Edwards in 1977-78. Miller stopped 20 shots, including the final 11 he faced.
The Sabres (52-21-7) matched their win total from last season and have clinched the Eastern Conference's top seed heading into the playoffs next week. They have two games left - Saturday at Washington and Sunday at Philadelphia.
Andrew Ference and Patrice Bergeron scored for the Bruins, who've been eliminated from playoff contention. They lost their fifth straight and are now 1-9-1 in their past 11.
Vanek's second goal, scored five minutes into the third period, put the Sabres ahead.
Getting to a loose puck at his own blue-line, Vanek streaked up the right wing ahead of defender Dennis Wideman. Approaching the Bruins' net, Vanek cut in front by outmuscling Wideman and then slipped a shot in through the legs of Hannu Toivonen.
After spotting the Bruins a 2-0 lead on Bergeron's power-play goal 14 minutes in, the Sabres tied the game before the first was over when Vanek scored on a wraparound, catching Toivonen looking the wrong way.
Miller's biggest save came in the second when he got across to rob Ference, set up for a blast at the right post.
The Sabres welcomed back Maxim Afinogenov, who played his first game after missing 21 with a broken left wrist. Afinogenov showed he hadn't lost a step midway through the second when he got around Ference and cut to the front of the net before having his sharp backhander stopped by Toivonen.
Afinogenov had an assist on Roy's goal.
Notes: Vanek became the first Sabres player to score 42 since 1992-'93 when Alexander Mogilny scored 76 goals and Pat LaFontaine added 53. ... Bruins RW Mark Mowers sat out after hurting his shoulder at Montreal on Tuesday. ... The Sabres became the fourth NHL team in the past 30 years to win 10 games in which they trailed by two goals. Carolina did it 10 times last year, while Edmonton, in 1983-'84, and Hartford, in 1985-'86, accomplished the feat 12 times.