Toronto moved one point ahead of Boston for second place in the Atlantic Division; the Bruins have five games in hand.
"Overall this was our best game against this team by far, we were able to do a lot of the things we wanted to do," Hainsey said. "We looked like we skated, we were really moving well up the ice and we looked pretty fresh for having played five games in a week."
WATCH: [All Bruins vs. Maple Leafs highlights]
Hainsey's shot from the point went past Rask's glove. The Bruins challenged for goaltender inference but the goal was upheld.
"You win some, you lose some. If we're generating more stuff around their net, maybe those calls go our way," Bruins coach Bruce Cassidy said when asked if he agreed with the call. "I think that was an issue tonight for us, we weren't around the front of their net enough. So no I'm not [upset], they made a good play to gain possession of the puck and got it to the net. It's up to us to be a little harder as well."
Mitchell Marner had a goal and three assists, Nazem Kadri scored twice, and Frederik Andersen made 20 saves for the Maple Leafs (39-20-5), who have won four in a row and matched their record with a ninth consecutive home win.