Chuck Kobasew added a goal and an assist for Boston, which snapped a three-game losing streak, and Petr Tenkrat, Patrice Bergeron, and Phil Kessel also scored. Marc Savard added three assists, and Tim Thomas made 35 saves.
Jiri Hudler had a goal and an assist for Detroit and Nicklas Lidstrom, and Robert Lang also scored for Detroit. Dominik Hasek stopped 19 shots.
The Bruins took the lead for good in the second period.
Sturm's second goal of the game, on the power play, tied the game 2-2, 5:43 into the middle period. He tipped in Marc Savard's pass for his 23rd goal. Petr Tenkrat put Boston ahead with 8:22 left in the period when he beat Hasek with a slap shot from the right circle after a turnover by Pavel Datsyuk.
Bergeron made it 4-2 with his 19th goal 2:35 into the third period. Hasek moved out of the net to make a play, but the puck took a funny carom off the rear boards to Bergeron, who shot the puck into the net before Hasek could get back in position.
Kobasew added a power-play goal 8:34 into the third period.
Lang got his 17th goal with 7:47 left.
Kessel scored with 5:41 remaining.
Boston got on the board first, 5:26 into the game, when Sturm's shot from the top of the right circle along the boards beat Hassock, who was screened.
But Hudler tied it with his 11th goal just 2:10 later when he knocked in a loose puck from in front of the net. Lidstrom gave Detroit the lead beating Thomas on a slap shot from the point for a power-play goal.
The game marked the return of Boston coach Dave Lewis to Detroit. Lewis was a Red Wing employee for 20 years, from 1986 until he became the Bruins' coach last summer.