David Krejci scored twice, Noel Acciari scored and Tuukka Rask made 23 saves for the Bruins (43-15-8), who are six points behind the Tampa Bay Lightning for the Atlantic Division lead and seven points ahead of the third-place Toronto Maple Leafs.
\[WATCH: All Blackhawks vs. Bruins highlights\]
Boston won its season-best sixth straight game and became the seventh team in NHL history to sweep a six-game homestand.
The Bruins, who trailed 4-3 after two periods, tied the game 4-4 on David Pastrnak's goal at 6:23 of the third.
"Obviously that's huge," Boston defenseman Nick Holden said. "We're trying to catch Tampa Bay and they keep winning, so we need to keep winning, so when you're at home you want to make sure you're playing your best hockey. Some of today's game, there were parts of it that were not quite as sound as we like, but for the most part I thought we played good hockey."
Erik Gustafsson had a goal and two assists, and Jonathan Toews, John Hayden and Matthew Highmore scored for the Blackhawks (29-32-8), who have lost their past two games and trail the Colorado Avalanche by 14 points for the second wild card into the Stanley Cup Playoffs from the Western Conference.
J-F Berube made 33 saves for Chicago, which gave up two power-play goals and four goals in the third period.
"I think we could have prevented a couple goals on the shorthanded side," Blackhawks coach Joel Quenneville said. "They've got a good power play and made some nice passes."
Acciari scored a shorthanded goal at 11:27 of the first period to give the Bruins a 1-0 lead, a rebound of Sean Kuraly's shot on a breakaway.