Fellow 20-year-old Kasatkina beat world number eight Williams 4-6 6-4 7-5.
It was the Russian's fourth consecutive victory over a current top-20 player, all of whom have won Grand Slams.
World number 19 Kasatkina overcame 2017 US Open champion Sloane Stephens in the third round, before beating January's Australian Open winner and world number two Caroline Wozniacki.
Then, in the last eight, she knocked out world number 10 Angelique Kerber, who won both the Australian and US titles in 2016.