Boston completed a 3-1 road trip.
The Stars had tied the game in the second period after trailing 2-0. But Frank Vatrano and Bergeron scored on deflections 40 seconds apart in the second, and Bergeron added his 16th goal of the season in the third period.
Brad Marchand, David Krejci scored in the first period for the Bruins. Marchand had two assists and Torey Krug had three assists.
John Klingberg and Jiri Hudler had second-period goals for Dallas, and Tyler Seguin scored in the third.