Frederic Brunet scored his first NHL goal, and Pavel Zacha and James Hagens each had two assists for the Bruins (6-2-0), who have won four in a row. Michael DiPietro made 25 saves for his first career NHL victory.
Tim Washe and Beckett Sennecke scored, and Lukas Dostal made 18 saves for the Ducks (4-3-0), who also blew a lead in a 4-2 loss to the Calgary Flames on Tuesday.
Brunet cut it to 2-1 with a power-play goal at 3:15 of the second period, scoring on a snap shot from just inside the blue line that fluttered through Dostal. The goal came shortly after DiPietro turned away Nikita Nesterenko on a short-handed breakaway.
Bruins defenseman Nikita Zadorov was assessed a double-minor for elbowing and roughing Frank Vatrano with a minute left in the second period. The power play continued into the third, but it ended when Ducks forward Roger McQueen was called for interference with 38 seconds left on the second penalty.
The Bruins then tied it 2-2 on the ensuing power play. Pastrnak's pass for Lindholm was broken up by Noah Warren, but the puck went right back to Pastrnak, who slid it into the open net with his backhand at 3:26.
Lindholm gave the Bruins a 3-2 lead with another power-play goal at 8:18 of the third. He scored from in front of the crease off a feed from Zacha.
Boston, which entered the night 3-for-18 on the power play, was 3-for-4 with the man-advantage. Anaheim was 0-for-5.
Matthew Poitras pushed the lead to 4-2 at 16:20, finishing a 2-on-1 rush with Hagens past the right pad of Dostal.
Washe gave the Ducks a 1-0 lead with 38 seconds remaining in the first period. He slid a wrist shot along the ice from above the left circle that went through the legs of linemate Jeff Malott and continued through the pads of a screened DiPietro.
The Ducks scored again just 21 seconds later to make it 2-0. Sennecke intercepted a clearing pass in the neutral zone, skated into the middle of the ice, and passed off to Cutter Gauthier, who made a touch pass to Nesterenko driving through the right circle. Nesterenko then quickly fed Sennecke, who was cutting toward the far post and redirected the puck into the net.