The Hurricanes improved to 3-0 against Boston this season despite trailing the second-placed Bruins by 18 points in the Eastern Conference standings.
"It shows we can compete with anybody," Hurricanes defenseman Jay Harrison told reporters. "On any given night, the effort you put in can be successful.
"That should suggest to this whole locker room that we aren't far from stringing something together and being very competitive."
Boston opened the scoring six minutes into the second period on a rebound goal by Patrice Bergeron. The Hurricanes responded with a strong push back and tied the score four minutes later with a tip-in by Patrick Dwyer.
Milan Lucic restored the Bruins' lead with a well-placed wrist shot to the top corner early in the third period.
Carolina took the lead for the first time with 90 seconds remaining after Harrison's shot from the blue line bounced off a couple of players before finishing in the net behind Thomas. It is the fourth goal in as many games for the defenseman.
"It's a good little string, and it's nice to contribute offensively," said Harrison. "My game revolves around playing strong, solid defense, making the first pass, penalty killing. Anything from there I can contribute is a bonus and I'm glad to do it."
The Bruins then pulled Thomas for an extra attacker in a late bid to force overtime but Eric Staal took advantage to score into the empty net with a minute remaining.
"Tonight we found a way to lose," Bruins coach Claude Julien said. "We had control of the game, not that it was our best game, but we still felt we had a certain control."