The Raptors won 131-127 in overtime.
DeRozan was perhaps inspired by some other basketball history. He said he spent some time earlier in the day watching the final few minutes of Game 6 of the 1998 NBA Finals, in which Hall of Famer Michael Jordan beat the Utah Jazz with a late jump shot, giving the Chicago Bulls their sixth title in eight seasons.
"I remember being a kid and wishing to be in moments like that," DeRozan said. "When you come out here and you're in those moments, you've got to make the best out of them."
"I for sure wanted to beat T-Ross," DeRozan joked about eclipsing his former teammate.
Current teammate Jonas Valanciunas interrupted DeRozan's postgame scrum by standing behind him and holding up a hand-lettered sign reading "52."
DeRozan's 52 points were also a new personal best, surpassing the 45-point game he had earlier this season against the Philadelphia 76ers.
"He was playing with a lot of juice," Raptors coach Dwane Casey said. "You could see the bounce in his step. Tonight, DeMar DeRozan played like a superstar."
DeRozan made 17 of 29 field goal attempts and shot 13-for-13 at the free throw line. His five 3-pointers were one shy of his career high. He scored the first nine points of the game and had 21 in the first quarter, the most by a Raptors player in a quarter this season.
"He's dangerous any time he puts on a uniform," Bucks coach Jason Kidd said. "Now to be able to expand his range out to the 3-point line just makes the game easier for him."
DeRozan added 8 assists, 5 rebounds, 1 steal and 1 block.
The Associated Press contributed to this report.