Tomas Tatar had a goal and an assist, and Nico Hischier and Dougie Hamilton each had two assists for the Devils (22-10-2), who are 1-6-1 in their past eight.
"We're kind of beating ourselves," Tatar said. "I don't think we played bad at all. We had a great start, had a great third. Even if they score one, we have to come back and keep playing because at the end of the game you never know what can happen."
Mackenzie Blackwood made 14 saves on 18 shots over two periods for New Jersey. He was replaced by Vitek Vanecek, who made five saves in the third period.
"We made some mistakes, they made some good plays," Blackwood said. "I screwed up a little bit, so just a combination of everything."
Jack Hughes gave the Devils a 1-0 lead in his 200th NHL game at 16:36 of the first period on a power-play goal from the top of the left face-off circle.
The Bruins scored four goals on 13 shots in the second period.
Patrice Bergeron tied it 1-1 at 3:12 on a redirection from the slot, and Pastrnak gave Boston a 2-1 lead 1:22 later on a backhand at the left post at 4:34.
Pastrnak pushed it to 3-1 at 9:52, settling a Krejci cross-ice pass in the right circle before scoring on a wrist shot.
"I mean, I play with Krejci, and he's never going to shoot it, so I guess somebody has to shoot on the line so that's my role," Pastrnak said.
DeBrusk scored from the slot after taking a pass from Brad Marchand for a 4-1 lead at 17:27 of the second on a giveaway behind the net by Devils defenseman Kevin Bahl.
"I just tried to get myself a little bit space towards the net and knew I had to elevate it," DeBrusk said. "It was a great play by [Marchand]; he passed it through a stick and it was a tap in."