On the winner, Colin White's blast from the left point hit Tim Thomas and caromed into two players in front of the crease. The puck found its way to Langenbrunner, who spun to face the cage and slipped the puck under a fallen Thomas.
Zach Parise and Patrik Elias also scored for the Devils, who blew a two-goal lead in the third period and had to rally late to earn their seventh straight win.
Scott Clemmensen made 24 stops for the win.
Chuck Kobasew, Marc Savard and Dennis Wideman tallied for the Bruins, who dropped their third game in five. Phil Kessel returned after missing six games with an illness and assisted on two goals.
Thomas stopped 26 shots in defeat.
Kobasew was credited with a disputed goal 2:19 into the third, then the Bruins tied it on another fluke play at 7:11. Milan Lucic carried the puck around the right of the Devils' net, where it was worked loose to Kessel on the opposite side. His pass found Savard in front, but he flubbed the shot and it barely trickled over Clemmensen's pad.
Wideman's one-timer from the point with 6 1/2 remaining put the Bruins ahead for the first time, 3-2. Savard began the rush on the right wing and pushed the puck ahead to Kessel, who dished to the defenseman from the right circle.
A victory for the home team was not to be, as Gionta's prayer from the left boards near the goal line with 1:45 left in the contest was answered by Elias' in the crease for a 3-3 tie.
The Devils got on the board while short-handed with 4:59 to play in the first as Langenbrunner's shot from the right wing trickled off Thomas' pads and slid over the goal line.
It was 2-0 with 6:21 left in the second when Parise banked a shot off Thomas from behind the net for a man-advantage marker.