McAvoy went to the net and tapped in Jake DeBrusk's pass from the left face-off circle on the rush 14 seconds after Boston killed a power play.
"I was just trying to go to the back post, and what a pass," McAvoy said of his first goal in 57 games, dating to March 27, 2019. "He put it right on my stick, and the rest is history. Everybody was saying, 'It's coming, it's coming.' Their response there was pretty neat.
"They were all busting my chops, but hopefully from there, a little more confidence and just start to maybe see more things go in for me."
WATCH: [All Bruins vs. Blackhawks highlights]
Chicago's Drake Caggiula scored shorthanded with 1:05 remaining in the third period on a delayed penalty against Boston defenseman Torey Krug, but the play had been blown dead.
"They made a mistake, blew the whistle," Blackhawks coach Jeremy Colliton said. "Not much you can say after that. It's done."
Bruins coach Bruce Cassidy said, "We heard the whistle on the bench. So if they'd have counted it, I was like, 'Wait a minute.' There was definitely a whistle."
Sean Kuraly scored for Boston (33-10-12), which leads the Atlantic Division by seven points over the Tampa Bay Lightning. Jaroslav Halak made 21 saves in his third straight win.