Sixth seed Zverev rolled through the opening set against Argentina's Diego Schwartzman under the roof on a rainswept Labor Day at Arthur Ashe Stadium, but lost his way to go down 3-6, 6-2, 6-4, 6-3.
The German was enjoying his deepest run in New York but committed 17 double faults and 65 unforced errors and received a point penalty for swearing as Schwartzman advanced to a second US Open quarter-final in three years.
"Generally my season so far has not been the best," said Zverev, who has reached just two quarter-finals in 18 Grand Slam appearances.
"Grand Slams were not actually worse than my season like they were last year and two years ago. I hope I can attack them next year."
Zverev said he was hindered a "very swollen" back and right hip following a fall in his previous match.
"I had a lot of chances which I didn't use early in the match. He kind of ran away with it."
Zverev lost his serve three times during the second set but appeared to have steadied himself when he moved a break ahead at 3-2 in the third, only for Schwartzman to wrest the momentum back in his favor after a lengthy sixth game.
"It was tough because I was feeling I had the chance to win this and I had a few break points I could not take," Schwartzman said. "He was up a break and then I recovered really quickly and I felt great after that."
Schwartzman, also a quarter-finalist at last year's French Open, matched his best Grand Slam run and awaits the winner between 18-time major champion Nadal and Croatian 22nd seed Cilic.
Nadal, a three-time US Open winner, has spent barely four hours on court in reaching the last 16, having benefited from a walkover in the second round.
Cilic, the 2017 Wimbledon finalist, withstood 40 aces from John Isner in round three but has defeated Nadal just twice in eight attempts.
"I've played quite a few times with Rafa. When you play these top guys you have to come up with your great tennis," Cilic said.
- Berretini in select club -
Matteo Berrettini became just the second Italian man to progress to the US Open quarter-finals, 42 years after Corrado Barazzutti's run to the last four in New York.
Berrettini, the 24th seed, eased to a 6-1, 6-4, 7-6 (8/6) win over Russia's 43rd-ranked Andrey Rublev to reach the last eight at a Grand Slam for the first time.
"It's something really crazy. I cannot believe it right now. I need a few hours to understand what happened," said Berrettini, 23, who goes on to play French 13th seed Gael Monfils.
"I'm just happy. Seeing my team and family here and crying, for me it's unbelievable."
Berrettini went one step further than his run to the last 16 at Wimbledon in July, where he was beaten by Roger Federer.
The Italian overcame a momentary lapse against Rublev as he dropped serve at 6-5 in the third set but sealed victory after two hours and 11 minutes in a tense tie-break.
"I think I did an unbelievable match. I thought Andrey was playing really good and playing with confidence," Berrettini said.
"I was mixing my tennis, using the slice, forehand and serve. I think all my weapons were really good today."
Monfils, a 2016 US Open semi-finalist, crushed the 33-year-old Andujar's bid to become the oldest player in the Open era to reach his first Grand Slam singles quarter-final with a 6-1, 6-2, 6-2 rout.
"I was very good tonight. I'm very happy," Monfils said. "I felt good and hit the ball very hard and I served good."