Brad Boyes, P.J. Axelsson and Glen Murray scored and Patrice Bergeron had two assists for the Bruins, who beat Tampa Bay for the third time this season and have won eight of 10 overall.
Eric Perrin and Vincent Lecavalier each had a goal and an assist and Martin St. Louis also scored for the Lightning (13-12-1), who lost their second straight after winning three in a row.
Boston came back from deficits of 2-1 and 3-2 to force overtime despite being outshot 31-22 in regulation. Tampa Bay has won just twice in its last 23 games in Boston.
Thomas saved 31 shots in regulation before turning away all seven Lightning attempts in the shootout to win his third consecutive start. He improved to 10-5-2 after winning only one of his first six decisions.
After starting the season 4-7-2, the Bruins (12-9-2) have used their current stretch to climb three games above .500 for the first time since ending the 2003-04 season 41-19-15-7.
Boston improved to 3-2 in shootouts.
Notes: Bruins defenceman Paul Mara sat out with a lower-body injury sustained in Boston's 4-1 win over Toronto on Tuesday. He is day-to-day. ... Bergeron extended his career-best point streak to eight games. ... Lecavalier has six assists against Boston this season. ... Tampa Bay dropped to 1-4-2 against the Northeast Division. ... Tampa Bay outshot Boston 14-8 in the second period. ... Each game between these teams has been decided by one goal.