Zheng, whose run to the Australian Open semi-finals along with that of compatriot Li Na electrified Chinese tennis, next faces Alicia Molik, with a chance to avenge her first round loss to the Australian in Dubai last month.
Molik, a 29-year-old who is on the comeback trail after a second career-threatening ailment, cruised into the round of 16 with a 6-0, 6-2 victory over British qualifier Elena Baltacha.
But Zheng toiled for two hours, 43 minutes to dispatch the 10th-seeded Sharapova - the second set alone taking 68 minutes.
After dropping her serve in the first game of the third set, Zheng broke back immediately. Sharapova broke again to take a 3-2 lead, after which she received treatment on court - and didn't win another game.
Sharapova had two double faults, including one on break point, in the eighth game as Zheng seized a 5-3 lead.
The 26-year-old from Cheng Du raced to a 40-0 lead, but missed her first opportunity to seal the match when she put a forehand into the net. She made no mistake on the next however, firing a forehand winner to the baseline.
The victory marked just the second time in five attempts that Zheng has won her opening match at Indian Wells.
Sharapova won the title in the California desert in 2006, but didn't play singles here last year as she continued her recovery from shoulder surgery.
The former world number one lost a three-set slugfest to compatriot Maria Kirilenko in the first round of the Australian Open, but bounced back last month by lifting the WTA title in Memphis.
In other women's matches, fifth-seeded Agnieszka Radwanska of Poland beat Argentina's Gisela Dulko 6-1, 6-0, advancing to a fouth-round meeting with France's Marion Bartoli - a 6-2, 6-0 winner over American Jill Craybas.
Second-seeded Caroline Wozniacki of Denmark was to take on Kirilenko, while Zheng's compatriot Peng Shuai faced Russian Nadia Petrova.