Marat Khusnutdinov and Casey Mittelstadt scored 50 seconds apart in the first period for the Bruins (34-21-5), who had lost three of four overall (1-1-2) but extended their home winning streak to 11 games.
Erik Karlsson scored the lone goal for the Penguins (31-16-13), who had their five-game point streak end (3-0-2). Stuart Skinner made 26 saves.
Karlsson gave the Penguins a 1-0 lead just 42 seconds into the game. Bryan Rust collected the puck behind the net following a turnover by Charlie McAvoy and moved it back up to the right point, where Karlsson scored with a wrist shot that found its way through traffic and past a screened Swayman.
Khusnutdinov tied it 1-1 at 5:10 of the first. Michael Eyssimont dug the puck out of the corner and fed Khusnutdinov for a quick wrist shot from the right face-off dot that beat Skinner to the far post.
Mittelstadt put Boston in front 2-1 less than a minute later at 6:00. He won a puck battle in the corner before finding a wide-open Nikita Zadorov at the top of the slot. Skinner made the initial save on Zadorov's shot, but the rebound went right to Mittelstadt, who scored past the diving goaltender from below the right circle.