Russian former world No 1 crashed out to 16th seed Sevastova before Kvitova beat Muguruza in the battle of Wimbledon champions.
Sharapova savours 'great ride' at US Open as Kvitova sets up Williams showdown
Maria Sharapova's grand slam return after a 15-month doping ban ended on Sunday with a fourth-round defeat at the US Open but the former world No 1 considered it a major step in her comeback.
Latvian 16th seed Anastasija Sevastova rallied to eliminate the five-time grand slam champion 5-7, 6-4, 6-2 at Arthur Ashe Stadium, booking a quarter-final against American Sloane Stephens, who ousted Germany's Julia Goerges 6-3, 3-6, 6-1.
Denis Shapovalov: Canadian showing he is the real deal at the US Open
Where is Wozniacki? Sharapova hits back at rival after US Open criticism
US Open predictions: Who will be crowned champion of the women's event?
Sharapova, the 2006 US Open winner, was able to find the positives after making 51 unforced errors to only 14 by Sevastova, whose 21 winners were half the 30-year-old Russian's total.
"Reflecting back on the week, I can be happy," Sharapova said. "It has been a really great ride. Ultimately, I can take a lot from this week."
Tuesday's other quarter-final will match Czech 13th seed Petra Kvitova, a two-time Wimbledon champion, against US ninth seed Venus Williams, seeking her eighth major title and third at the US Open.
Kvitova eliminated Spanish third seed and two-time slam winner Garbine Muguruza 7-6, 6-3 while Williams beat 35th-ranked Spaniard Carla Suarez Navarro 6-3, 3-6, 6-1.
"She played unbelievable throughout the first and second set and I just kept fighting, running for every ball," Sevastova said after her win over Sharapova. "I was confident. I was feeling it. But still you have to beat her. She was playing one of the best matches here."
Sharapova returned from her suspension in April, was snubbed for a French Open wildcard and missed Wimbledon with a thigh injury but received a US Open wildcard despite only one hardcourt tuneup match due to a left forearm injury.
"It's great to get that major out of the way," Sharapova said. "I'm thankful for the opportunity. I did my best and I can be proud of that."
Sharapova is expected to jump from 146th to around 100th in the world rankings.
Williams, 37, is the oldest woman entered but was this year's Wimbledon and Australian Open runner-up. She hasn't reached three slam finals in a year since 2002.
"I'm focused on myself and trying to be as aggressive as possible," Williams said. "Nobody ever gives you a slam. You've got to take it and I'm going to try and take it."
Kvitova, 4-1 all-time against Williams, missed five months after a knife-wielding home intruder injured her left hand last December.
"I worked hard to come back and be here. It means a lot," Kvitova said. "I don't have words to describe. It was a tough time. All five months were very tough. It was just a journey I didn't know how it would end. If it ends here on the big stage it's a happy end."
Muguruza still leads the fight for world No 1 after the US Open but will be overtaken if fourth seed Elina Svitolina makes the semi-finals or top seed Karolina Pliskova reaches the final.
Stephens missed 11 months with a foot injury and returned only at Wimbledon, but has won 12 of her past 14 matches for her deepest US Open run in six tries.
"I honestly couldn't have asked for a better comeback," Stephens said. "Making it to the quarter-finals here is unbelievable."