"I had a rough first outing in the preseason and it's good to follow it up with a strong one," said Thomas, the Vezina Trophy winner last season as the NHL's top goalie. "It doesn't mean that everything's perfect now, but it's a step in the right direction."
Halak made 26 saves for Montreal (3-2-1).
Canadiens left wing Mike Cammalleri left the game because of an undisclosed lower-body injury after the first period. He did not return.
"It's more precautionary, nothing serious," coach Jacques Martin said. "We just wanted to make sure that it didn't get worse and we feel that it'll be all right. Whether he'll play Saturday, we'll see, but what's more important is October 1st."
Kostitsyn pushed home Tomas Plekanec's rebound from the right edge of the crease 59 seconds into the second after the puck became loose behind Thomas.
Stuart tied it early in the third when he took Michael Ryder's centering pass from behind the net and put a backhand past Halak.
Bruins center Vladimir Sobotka collided with Halak behind the Canadiens' net later in the period, sending the Slovak goalie's mask flying. No penalty was called on the play as players from both teams exchanged words. Halak lay on the ice for several moments, though he remained in the game.
Montreal coach Jacques Martin used his timeout 3:50 into overtime after Boston was called for too many men with 4 seconds remaining in Canadiens right wing Matt D'Agostini's minor penalty.
Bruins coach Claude Julien used a similar opportunity to strategize when he called time after D'Agostini was sent off for tripping Andrew Ference at 1:53.
The Canadiens held a 34-27 advantage in shots overall, including a 5-4 edge in overtime despite killing D'Agostini's entire penalty.
"I think it was his first shot," Stewart said. "He's a lefty and I kind of opened myself up and he just got me with a good shot to the eye. It kind of made me a little more (upset), knowing that I was bleeding, so I had to do something to redeem myself."
Copyright by STATS LLC and The Associated Press
Arena: Bell Centre Location: Montreal, Quebec
Attendance: 21,273 (100.0% full)
No scoring this period
Sergei Kostitsyn Assist: Tomas Plekanec
Mark Stuart Assist: Michael Ryder
No scoring this period
Matt D'Agostini shootout attempt against Tim Thomas: SAVED.
Blake Wheeler shootout attempt against Jaroslav Halak: SAVED.
Tomas Plekanec shootout attempt against Tim Thomas: MISSED.
Patrice Bergeron shootout attempt against Jaroslav Halak: GOAL.
Scott Gomez shootout attempt against Tim Thomas: SAVED.