Boston dominated early, then scored twice in the third period to grab a 4-3 lead. After New Jersey's Bobby Holik tied it in the final minute, Bruins goaltender Byron Dafoe turned aside a shot by Jason Arnott and Boston counterattacked.
Sergei Samsonov, who got the tying tally early in the third period, carried down the left side and left a drop pass for Thornton. The Bruins' leading scorer leaned into a slapper that beat Brodeur to the glove side for his eighth goal of the season and second in overtime.
Thornton also scored in the extra period to defeat Toronto, 2-1, on Oct. 25.
Former Devil Bill Guerin had a goal and two assists for Boston, whose last four victories over New Jersey have been by one goal.
Brodeur made 39 saves for the Devils, who fell to 8-3-1 in the last 12 games, with two of the losses coming against the Bruins.