WATCH the Miami Open LIVE & ONLY on beIN SPORTS | available via Foxtel, Kayo Sports, Fetch TV & beIN SPORTS CONNECT
World number two Osaka, a four-time Grand Slam champion who was chasing her first Miami crown, only won eight points in the first set, never managing a winner.
Osaka broke in the second game of the second set and seized a 3-0 lead before Sakkari roared back.
Sakkari broke Osaka for the second time in the match after trailing 40-0 to seize a 5-4 advantage, then served out to win the match after 69 minutes when Osaka sent a forehand beyond the baseline.
"She has the most wins so far this year so she's in great form - it meant a lot to me," Sakkari said of the victory, which prompted a scream of delight after the final point.
"I was focused on my returns. I had to mix it up well. Overall, it was a pretty clever match."
Sakkari, the 23rd seed, advanced to a semi-final against the winner of a later match between Canadian eighth seed Bianca Andreescu and Spain's Sara Sorribes Tormo.
"Just during my cool down I'll enjoy it with my team, then get back to work," Sakkari said of turning her attention to her next match.
Osaka won only 3-of-13 second-serve points in the opening set and had only a 35% accuracy rate on first serves as Sakkari dominated early, taking 13 straight points on Osaka's serve in one stretch.
"I played a great first set," Sakkari said. "I didn't make many unforced errors. I just came out with a good game plan."
Osaka had not dropped a set at love since her last defeat, which came in February 2020 in a Fed Cup match.
But Sakkari had to battle back to overcome Osaka's fightback.
"To be deadly honest, I got a little tight in the first two games of the second set," Sakkari said.
"I had two break points and didn't take them, then a bad service game, which can happen. I stayed within myself and started fighting back, hitting a few more balls and winning a few points against her."
In later men's quarter-finals, top seed Daniil Medvedev of Russia will face Spanish seventh seed Roberto Bautista Agut and Italian 21st seed Jannik Sinner will play 32nd seed Alexander Bublik of Kazakhstan.