Reserve Goran Dragic had a game-high-tying 26 points as the Miami Heat recovered from a miserable performance against Milwaukee to beat the visiting Bucks 119-108 on Wednesday night.

The game was a much more competitive rematch of the Tuesday contest, a Bucks 144-97 victory. The Bucks set an NBA record in that game with 29 3-pointers, hitting 56.9 percent from long range.

On Wednesday, Miami’s Bam Adebayo had 22 points and 10 assists while Tyler Herro put up 21 points and a career-high 15 rebounds. Herro and Dragic — Miami’s top two point guards — combined for 47 points, 20 rebounds and six assists in 55 minutes.

Giannis Antetokounmpo led Milwaukee with 26 points, 13 rebounds and 10 assists, recording his 19th career triple-double.

However, the Bucks’ Khris Middleton, who scored 25 points Tuesday, was held to eight points on Wednesday as he made just 3 of 15 shots. After sinking 4 of 5 3-point attempts Tuesday, he missed all four of his shots from long distance 24 hours later.

Milwaukee made 16 of 41 attempts (39 percent) from beyond the arc in the rematch after going 29 of 51 on Tuesday. Miami went 15 of 39 (38.5 percent) from 3-point range on Wednesday.

Heat star Jimmy Butler sat out his second consecutive game due to a sprained right ankle.

Milwaukee’s hot shooting from Tuesday did not carry over to Wednesday’s first quarter as the Bucks shot just 22.7 percent from the floor and 3-for-12 on 3-point tries. Miami shot 52.6 percent from the floor and led 25-19 thanks to an 11-0 run to close the quarter.

By halftime, though, Milwaukee had surged on top 56-51. Adebayo (14 points) and Dragic (13) were the top first-half scorers, but the Bucks made seven 3-pointers in the second quarter to overcome Miami.

The Bucks took their largest lead of the game, 72-58, with eight minutes left in the third quarter on an Antetokounmpo dunk. Antetokounmpo had 14 points in the period, but Miami made a run and went into the fourth trailing 91-88 as Herro hit a 3-pointer at the buzzer.

That momentum carried through to the fourth quarter as the Heat pulled out to a 112-99 advantage with 4:39 left and cruised from there.

Milwaukee was plus-9 on turnovers. Miami won despite turning the ball over 22 times.