Sharapova, downed second-ranked Simona Halep in her first Grand Slam match after a 15-month doping ban.
Sharapova, who downed second-ranked Simona Halep in her first Grand Slam match after a 15-month doping ban, defeated Hungary's 59th-ranked Timea Babos 6-7 (4/7), 6-4, 6-1 at Arthur Ashe Stadium.
"It wasn't my best tennis," Sharapova said. "It was scrappy tennis but sometimes those kind of matches are a lot of fun and this was one of those days."
The 30-year-old Russian, who next faces Russian-born US teen Sofia Kenin, tested positive for meldonium at the 2016 Australian Open, her most recent Grand Slam appearance until this week.
"Every day I have the chance I have to play at the US Open is a special day and I'll look forward to the next one," 146th-ranked Sharapova said.
Sharapova, whose five Grand Slam titles include the 2006 US Open, played only one Open tuneup match after a forearm injury but wore down Halep and Babos to prove she's a threat for a deep run, with Latvian 16th seed Anastasija Sevastova her top-ranked potential semi-final obstacle.
Fourth seed Zverev, whose five ATP titles this year include a win over Roger Federer in this month's Montreal final, fell to 61st-ranked Croatian Borna Coric 3-6, 7-5, 7-6 (7/1), 7-6 (7/4).
The 20-year-old German had been the highest-ranked player in his half of an injury-hit Open draw.
"It's upsetting because the draw is pretty open in the bottom part," Zverev said. "I felt like I should have been the favorite there. I just played a very, very bad match, so it's unfortunate."
Coric, who faces South African Kevin Anderson for a last-16 berth, was one point from a fifth set before winning five in a row to force the deciding tie-breaker.
"I was just thinking to keep the points shorter," Coric said. "And yeah, I was a little bit lucky."
Zverev's ouster left US 10th seed John Isner the top-ranked player in his draw quarter and Croatian fifth seed Marin Cilic the best in his half of the draw.
Wimbledon runner-up Cilic, the 2014 US Open winner, reached the third round by beating Germany's Florian Mayer 6-3, 6-3, 6-3.
Kyrgios, the 14th seed and former top-rated obstacle in Federer's quarter-final path, hurt his right shoulder in a 6-3, 1-6, 6-4, 6-1 first-round loss to 235th-ranked fellow Aussie John Millman.
"Early in the third set I hit one serve and I never felt the same after that," Kyrgios said. "Something didn't feel right in my arm."
Kyrgios, 22, dropped eight of the last nine games.
"Nick's shoulder deteriorated as the match went on," Millman said after his first US Open triumph. "It's a victory but slightly hollow."
Austrian sixth seed Dominic Thiem ousted Aussie Alex de Minaur 6-4, 6-1, 6-1. Thiem is the highest-ranked rival on the Federer and Nadal side of the draw.
Canadian 18-year-old qualifier Denis Shapovalov defeated French eighth seed Jo-Wilfried Tsonga 6-4, 6-4, 7-6 (7/3) to book a third-round date with Britain's Kyle Edmund.
"It's a dream come true for me," Shapovalov said.
Shapovalov became the youngest man in the third round of a Grand Slam since Bernard Tomic at the 2011 Australian Open and at the US Open since American Donald Young in 2007.
Wimbledon champion Garbine Muguruza reached the US Open third round for the first time by beating China's 92nd-ranked Duan Ying-Ying 6-4, 6-0.
"I had like a curse and I broke it finally. I'm so happy," Muguruza said. "I just put the heart on the court. I knew I had to be all the time fighting for the ball and in the end I won."
Beating Slovakian Magdalena Rybarikova to reach the last 16 would put the third-seeded Spaniard atop a fight for world number one that was trimmed to six women when Danish fifth seed Caroline Wozniacki lost to Russia's Ekaterina Makarova 6-2, 6-7 (5/7), 6-1.
Russian eighth seed Svetlana Kuznetsova, the 2004 US Open champion, rescued three match points in defeating 67th-ranked Czech Marketa Vondrousova 4-6, 6-4, 7-6 (7/2) to stay in the hunt for number one.
Ukraine's fourth-seeded Elina Svitolina did as well, downing 42nd-ranked Czech Katerina Siniakova 6-0, 6-7 (5/7), 6-3.
Another top spot hopeful is seven-time Grand Slam champion Venus Williams, the 37-year-old US ninth seed who beat France's Oceane Dodin 7-5, 6-4.