Eric Bledsoe and Khris Middleton each scored 21 points as the Bucks won the opener of an eight-game stretch against teams in playoff contention. Jason Terry scored 14 points, and John Henson and Thon Maker each had 12.
DeMar DeRozan scored 33 points for the Raptors, who had won five straight home meetings with the Bucks. Serge Ibaka had 18 points, and Kyle Lowry and Pascal Siakam each scored 17.
Jonas Valanciunas' buzzer-beating dunk for Toronto sent the game to overtime. He finished with 10 points.
Toronto suffered its first home loss since Jan. 26 against Utah. The Raptors are an NBA-best 24-5 at home.
Toronto and Milwaukee also played an overtime game on Jan. 1, with DeRozan setting a team record with 52 points in the Raptors' 131-127 win.
The Raptors trailed 110-108 with 3.3 seconds left in the fourth quarter after Middleton split a pair of free throws. Following a timeout, Toronto inbounded the ball to Valanciunas, who paused before driving for the tying dunk.
Toronto scored the first five points of the extra session, but back-to-back 3-pointers by Terry and Middleton capped an 8-0 Bucks run, giving Milwaukee a 118-115 lead with 1:58 left.
Valanciunas stopped the run with a dunk, but Antetokounmpo's jumper with 13 seconds left put the Bucks up 120-117.
DeRozan cut it to one with a dunk but Terry answered with a pair of free throws in the final second. DeRozan's long inbounds pass to C.J. Miles was knocked away at the buzzer to give the Bucks the win.
Bucks: Visit New Orleans on Sunday afternoon. The Bucks have lost their past two meetings with the Pelicans.
Raptors: Host Detroit on Monday night. Toronto has won three straight against the Pistons.