The 19-year-old Japanese player posted a 7-5, 6-2 victory to exact a bit of revenge from getting bounced by Williams in their Wimbledon match earlier this year.
"I feel like even if I hit one semi-short ball she would come in and crush it, so I had to play really well," the 64th-ranked Osaka said of defeating the fifth-ranked Williams. The win comes on the heels of Osaka upsetting sixth-ranked Angelique Kerber at the U.S. Open.
Williams benefited from a double fault by Osaka to earn the first break of the match, but the 37-year-old was unable to capitalize. Osaka rebounded with a flourish to claim the first set and rushed out to a 5-0 edge in the second before dismissing the American in 1 hour, 24 minutes.
Osaka advanced to face Russian Anastasia Pavlyuchenkova in the quarterfinal, who posted a 7-6 (3), 6-1 win over American Jacqueline Cako. Pavlyuchenkova overcame three double faults to win her match in 1 hour, 34 minutes.
"I thought I was playing pretty well, and genuinely enjoying playing out here," Stosur said after her eight-ace performance. "I felt like as the match went on I kept getting better and better."
Seventh-seeded Australian Daria Gavrilova also required three sets to topple American Shelby Rogers with a 6-1, 2-6, 6-2 triumph.