David Pastrnak carried the puck into the zone and dished to Zacha, who scored from the left circle.
Pastrnak had a goal and two assists and extended his point streak to 11 games. The forward has seven goals and 11 assists during his streak.
Viktor Arvidsson and Casey Mittelstadt also scored, and Joonas Korpisalo made 22 saves for the Bruins (40-24-8), who have won three of four.
Boston holds the first wild card into the Stanley Cup Playoffs from the Eastern Conference, three points ahead of the Ottawa Senators. Boston is tied in points with the Montreal Canadiens for third in the Atlantic Division but have played two more games.
Jason Zucker scored twice and Tage Thompson had two assists for the Sabres (44-20-8). Ukko Pekka Luukkonen made 27 saves.
Buffalo, which leads the Atlantic, tied the Carolina Hurricanes for first place in the Eastern Conference. Carolina has a game in hand.
The Sabres scored twice in 33 seconds in the third period to take a 3-2 lead.
Zach Benson stripped Mason Lohrei of the puck at the Bruins blue line, skated to the net and stopped in front before putting it past Korpisalo’s right skate to tie it 2-2 at 5:21 of the third period.
Lohrei cross-checked Benson after the goal, and on the ensuing power play Zucker put Buffalo ahead 3-2 at 5:54. Thompson looped around the net and sent a pass through the crease to Zucker on the doorstep in front.
Mittelstadt tied it 3-3 at 14:00. Jonathan Aspirot’s point shot bounced off the end boards, then off Luukkonen’s skate in the crease, and Mittelstadt was in front to put it in.
Pastrnak gave Boston a 1-0 lead at 11:07 of the first period. He received a pass from Fraser Minten low in the right circle and snapped it over Luukkonen’s stick and off the far post.
Zucker scored on the power play to tie it 1-1 at 15:18. Thompson skated around Marat Khusnutdinov to the left circle where he slipped a pass through Hampus Lindholm’s legs to Zucker at the left hash mark.
Arvidsson made it 2-1 when he backhanded a loose puck under Luukkonen’s arm from in front at 9:45 after the goalie poke-checked it away from Pastrnak.