The Magic had a 14% chance to land the top pick, along with the Houston Rockets and the Detroit Pistons. It is the Magic's first time holding the No. 1 overall pick since 2004, when the team selected eight-time All-Star center Dwight Howard.
Orlando also won the lottery in back-to-back years in 1992 (Shaquille O'Neal) and 1993 (Chris Webber). Webber was later traded to the Golden State Warriors for Penny Hardaway and three future first-round draft picks.
The Oklahoma City Thunder, meanwhile, landed the No. 2 pick in this year's draft. It will be the franchise's first top-four selection since 2009, when the team selected James Harden.
The Thunder also have a second lottery pick at No. 12 as a result of the Paul George trade with the Los Angeles Clippers.
The Houston Rockets, who picked No. 2 in last year's draft, secured the third pick this time around. It will be the first time that Houston picks in the top four in consecutive years since 1983-84.
The Sacramento Kings grabbed the No. 4 overall pick after having just a 7.5% chance to jump into the top four. They climbed ahead of the Detroit Pistons, who will now select fifth.
The Indiana Pacers will pick at No. 6 overall -- the first time they've had a top-nine selection since 1989 -- followed by the Portland Trail Blazers at No. 7.
Because the Los Angeles Lakers' draft choice fell inside the top 10 at No. 8, that selection goes to the New Orleans Pelicans as part of the Anthony Davis trade from 2019.
That pick had a 99.6% chance of conferring to the Pelicans. If it didn't, the selection would have gone to the Memphis Grizzlies as part of the trade that sent Jonas Valanciunas to New Orleans and Steven Adams and Eric Bledsoe to the Grizzlies.
Instead, Memphis receives the Cleveland Cavaliers' 2022 second-round pick via the Pelicans, in addition to New Orleans' 2025 second-rounder.
The San Antonio Spurs (ninth), Washington Wizards (10th), New York Knicks (11th), Charlotte Hornets (13th) and Cavaliers (14th) rounded out the lottery.
This year's NBA Draft is set for June 23 at Barclays Center in Brooklyn.