MILWAUKEE — DeMar DeRozan scored 32 points and the Toronto Raptors squandered a 25-point lead late in the third quarter Thursday night before holding on for a 92-89 victory against the Milwaukee Bucks to take their first-round playoff series in six games.

Cory Joseph had five points in a 9-0 run in the final two minutes, including a 3-pointer with 1:27 left to help stave off the pesky Bucks.

The Raptors move on to face the Cleveland Cavaliers in the Eastern Conference semifinals in a series that starts Monday. They’ll need to work on finishing off opponents in the second half.

Jason Terry’s 3-pointer with 3:06 left gave the Bucks an 80-78 lead, completing an unlikely comeback from the 25-point deficit with 5:16 left in the third quarter. The Raptors looked as if they were on cruise control after DeMarre Carroll’s 3 gave them the 71-46 advantage.

Giannis Antetokounmpo spearheaded the second-half rally. He had 34 points.

The furious effort appeared to sap the energy of the young Bucks. Even Antetokounmpo, a renowned gym rat, looked tired, catching his breath during fourth-quarter breaks. He played 47 minutes.

Antetokounmpo finished 13 of 23 from the field but was 2 of 6 in the fourth.

The Raptors finally could breathe easy after DeRozan went 2 of 2 from the foul line with 3.1 seconds left for a three-point lead. Tony Snell’s inbounds pass on the ensuing possession was intercepted by DeRozan.

Rebounding from a 2-1 series deficit and an embarrassing 27-point loss in Game 3, the Raptors will face Cleveland a year after losing to the Cavaliers in the Eastern Conference finals in six games.

Kyle Lowry added 13 points for Toronto.

NOTES

KNICKS: Center Joakim Noah had right shoulder surgery to repair his rotator cuff, a procedure that could sideline him until training camp.

The team didn’t give a timetable for Noah’s recovery, but Coach Jeff Hornacek said late in the season that if Noah had the operation, the recovery time could be five months.