Andrei Markov got the other goal as the Habs won their fifth straight game and forged a tie with Philadelphia for sixth place in the NHL's Eastern Conference.
Halak notched his 22nd win of the year with the performance.
The Canadiens got the game-deciding goal when Boston netminder Tuuka Rask misplayed a Hal Gill dump-in, and Kostitsyn, cruising through the slot, picked up the loose puck and shoveled it into the net for a 3-1 lead at 1:41 of the final stanza.
The Bruins got goals from Blake Wheeler and Milan Lucic while dropping their third game in four tries. Rask let in three goals on 27 shots in the loss.
Exploding whale video goes viral on Internet
Texas principal bans speaking Spanish, stirs controversy