Patrice Bergeron and Garnet Hathaway scored, and Linus Ullmark made 26 saves for Boston (56-11-5), which has won six straight game and clinched the division for the first time since 2019-20.
"I think 85 percent of the game was will [over skill] for both teams," Bruins coach Jim Montgomery said. "I think it just made for a really good hockey game. Maybe a late 80s, early 90s [type of] hockey game, but it's great because we're going to face this in the playoffs."
Victor Hedman scored, and Andrei Vasilevskiy made 32 saves for Tampa Bay (42-26-6), which has lost four straight.
The Lightning remained five points behind the Toronto Maple Leafs, who have two games in hand, for second in the Atlantic.
"It's tough to say it's a great loss," Tampa Bay forward Pierre-Edouard Bellemare said. "But at the end of the day, we showed up and [had] way more emotion, way more passion, and it's not the outcome that we wanted, but the process is pretty much as close [to what] we wanted as possible."
Hathaway gave the Bruins a 2-1 lead at 17:32 of the second period, scoring on his own rebound in front after his initial redirection was stopped by Vasilevskiy.
"As a team we've been looking forward to this, to a team that's going to be in the playoffs and we potentially could see," Hathaway said. "[They're] a team that's battling right now, and you're going to play that same way. It's encouraging for us as a line, but encouraging for us as a team to play that way."