Keys won a three-set cliffhanger in the previous round in a match tiebreaker when she fought off five match points. Two days later came a 1-6 7-6 (7-3) 7-5 collapse that was as out-of-nowhere as that comeback.
Fellow American Amanda Anisimova, like Keys a past US Open runner-up, was also knocked out when the No.10 seed lost 6-2 7-5 to Russian Anastasia Potapova.
But Coco Gauff provided a bright spot for the Americans, the fourth seed overcoming Spain's Cristina Bucsa 6-3 6-4 to book her place in the last 16.
The 2023 champion overcame some early struggles on serve to secure another convincing victory and keep her bid for a third grand slam title alive.
Keys, the 2017 finalist, rebounded after losing the second-set tiebreaker to charge out to 5-0 lead. Zheng held but Keys had a match point while serving at 5-1.
But once she failed to convert that, the turnaround was on, with Keys at one point banging her racquet into her head repeatedly and pulling off her visor in disgust.
"I'm just telling myself keep holding every single point, never give up, stay there and somehow little by little it just happened," Zheng said.
She won the gold medal for China at the 2024 Olympics after reaching the Australian Open final that year, and has been ranked as high as No.4. But after elbow surgery, she is down to No.121 and had to go through qualifying just to make the main draw.
"The hard work pays off," Zheng said after booking a last-16 clash with six-times grand slam champion Iga Swiatek.
Poland's eighth seed In other matches dug her heels in to get past Czech Marie Bouzkova 7-6 (7-3) 7-6 (7-3) to keep her critic-quietening campaign alive.
The 2022 winner arrived in New York amid the most difficult season of her career but had plenty of fight left as she broke down her opponent with 18 forehand winners.
"It got pretty physical, many long rallies," said 25-year-old Swiatek.
"It wasn't easy."
Russian fifth seed Mirra Andreeva moved past Czech Nikola Bartunkova 6-2 7-6 (7-5).
Later, Naomi Osaka, the two-time champion from Japan, advanced with a 6-3 3-6 7-5 win over Belgium's Elise Mertens.
And 18-year-old American Iva Jovic beat Alex Eala of the Philippines 6-3 3-6 7-5 in a night match to set up a clash with countrywoman Gauff.
Anisimova missed repeated opportunities by converting just three of 16 break-point chances. Potapova, a 25-year-old who was born in Russia but now represents Austria, went six for eight and matched her best showing in a grand slam tournament by reaching the fourth round.
Anisimova went to the final at both Wimbledon and the US Open last year, falling to Aryna Sabalenka in Flushing Meadows. But after reaching the quarter-finals of the Australian Open, the American was eliminated in the third round of the last three majors this year.