The 31-year-old, a victor of 15 Grand Slam titles, will take on compatriot Albert Ramos Viñolas in round four.
Roger Federer's withdrawal from this week's event due to a back injury means Nadal will reclaim the world number one berth for the first time since the summer of 2014 when the rankings are refreshed on Monday, no matter how he performs in Cincinnati.
Riding a 10-match win streak after titles in Montreal and Washington, Zverev was a favorite to capture his seventh title of the year in the last major US Open hard court tune-up.
But he lost 6-4 3-6 4-6 to 19-year-old Tiafoe, the world number 87.
"It's been great. I won back-to-back weeks, two big events".
'I'm not a machine. I think he has looked at the draw and seen that Roger is out and Milos is out.
"I'm completely dead right now", Zverev said. But it's something that's normal. It happens to all of us'.
"I can't believe it", Tiafoe said.
Nick Saban wonders 'why do we even play?' in epic media rant
Because you guys have got all these conclusions already drawn about who's what, how good they are, what they can do. He's doing a nice job. "He had a lot of production points in the scrimmage so we're really happy with the progress".
'I'm the only one of these top players that missed a lot of important tournaments in my career.
United States ninth seed Venus Williams downed compatriot Alison Riske 6-2, 6-0 to book a second-round match with Australian qualifier Ashleigh Barty.
Barty had never beaten a player in the top 10 before but held her nerve to secure a 6-3, 2-6, 6-2 victory over the 37-year-old American.
Williams, 37, served up six double faults in an error-strewn performance.
As a young player it might take time to build up confidence on the court and develop an ability to handle pressure effectively when pitted against seasoned opponents but Zverev seemed unfazed.
In other games, Bulgarian Grigor Dimitrov eased past Feliciano Lopez from Spain 7-6 (7-5) 6-4 to reach the third round where he will face Argentine Juan Martin del Potro who continued his fine form.
French Open champion Jelena Ostapenko of Latvia was ousted by Serbian qualifier Aleksandra Krunic 6-4, 6-2 while Russian lucky loser Natalia Vikhlyantseva beat Croatia's Donna Vekic 6-3, 2-6, 6-3 to book a matchup with Czech women's world number one Karolina Pliskova.
On the women's side, Wimbledon victor Garbine Muguruza, and second-ranked Simona Halep cruised into the third round.
Third seed Dominic Thiem of Austria joined Nadal and Tiafoe in the fourth round as he overcame Fabio Fognini 6-3, 6-2.