French Open champion Barty, bidding to become the first Australian champion at Wimbledon since 1980, lost 3-6, 6-2, 6-3 to the world number 55.
Riske, who will marry Stephen Amritraj, the son of former Indian Davis Cup player Anand, in Pittsburgh after Wimbledon, goes on to face seven-time champion Serena Williams for a place in the semi-finals.
It will be the 29-year-old's first appearance in a Grand Slam quarter-final.
"I wish I could get married more often. Maybe we'll have to renew our vows because it's worked out well having that on the horizon," said Riske on how her impending nuptials have helped her game.
"I'm looking forward to it so much. Everything is pretty much already in stone. I'm not really stressed about it.
"I haven't been stressed about it really from the beginning probably because my fiance has been doing all the work."
Defeat brought an end to 23-year-old Barty's 15-match winning run.
However, she had been dominant at the start on Monday, serving up four successive aces in the opening game on Court 2 before breaking for a 3-1 lead.
Riske, who had spent four more hours on court than the Australian in getting this far, retrieved the break in the eighth game but it was a brief reprieve as Barty took the opener.
Riske had won the grass court title at 's-Hertogenbosch in the run-up to Wimbledon and her credentials on the surface eventually shone through as the match progressed.
She broke in the fourth and eighth games of the second set and carved out the key break of the decider in the eighth game.
It was all over when Barty speared a forehand wide of the court.
On the prospect of facing Williams for a place in the last four, she said: "Bring it on!"
"It's super exciting. I played doubles with Serena, but never played against her. It will be an interesting match," added Riske.
"Today was a great preparation for me going into the Serena match. Again, I'm ready for a war. She's the greatest athlete I think that's ever been on the women's side."
Riske had reached her second career Grand Slam fourth round the hard way, coming back from a 1-4 final set deficit to defeat Croatia's Donna Vekic in the first round.
She then needed a 9-7 third set to see off Serbia's Ivana Jorovic before hitting back from 0-3 down in the decider to beat Swiss 13th seed Belinda Bencic in the third round.
"I had to play aggressive. I had to take it to Ash," said Riske
"The grass definitely brings out the best in me. Hopefully it will rub off and happen in other places too.
"I have a great return game and I think grass just really suits my game and I feel at home here. I really don't want Wimbledon to end."
Wimbledon results on Monday (x denotes seeding):
Novak Djokovic (SRB x1) bt Ugo Humbert (FRA) 6-3, 6-2, 6-3
David Goffin (BEL x21) bt Fernando Verdasco (ESP) 7-6 (11/9), 2-6, 6-3, 6-4
Roberto Bautista Agut (ESP x23) bt Benoit Paire (FRA x28) 6-3, 7-5, 6-
Sam Querrey (USA) bt Tennys Sandgren (USA) 6-4, 6-7 (7/9), 7-6 (7/3), 7-6 (7/5)
Rafael Nadal (ESP x3) bt Joao Sousa (POR) 6-2, 6-2, 6-2
Kei Nishikori (JPN x8) bt Mikhail Kukushkin (KAZ) 6-3, 3-6, 6-3, 6-4
Roger Federer (SUI x2) bt Matteo Berrettini (ITA x17) 6-1, 6-2, 6-2
Alison Riske (USA) bt Ashleigh Barty (AUS x1) 3-6, 6-2, 6-3
Serena Williams (USA x11) bt Carla Suarez Navarro (ESP x30) 6-2, 6-2
Barbora Strycova (CZE) bt Elise Mertens (BEL x21) 4-6, 7-5, 6-2
Johanna Konta (GBR x19) bt Petra Kvitova (CZE x6) 4-6, 6-2, 6-4
Elina Svitolina (UKR x8) bt Petra Martic (CRO x24) 6-4, 6-2
Karolina Muchova (CZE) bt Karolína Pliskova (CZE x3) 4-6, 7-5, 13-11
Simona Halep (ROU x7) bt Cori Gauff (USA) 6-3, 6-3
Zhang Shuai (CHN) bt Dayana Yastremska (UKR) 6-4, 1-6, 6-2