MarShon Brooks scored 17 points, 15 of them in the final quarter, and Kelly Olynyk fouled out with 13 points and nine rebounds for the Celtics.
The Raptors used a 10-0 run in the final 4:36 of the third quarter to take an 80-70 lead into the fourth. Boston missed seven straight field goal attempts after Green's dunk with 4:50 to go in the third put them up 70-69, their final lead of the game.
Brooks hit a 3 with 24 seconds left to cut it to 97-95, but Julyan Stone answered with a pair of free throws for the Raptors. Stone then missed a layup with seven seconds to go, setting up the frantic finish.
The Celtics and Raptors open the regular season in Toronto on Oct. 30.