Sharapova, who returned to tennis last April following a 15-month doping ban, continued to struggle to find form this season as she dug herself into an early hole and never fully recovered.
Now ranked 41st in the world, Sharapova fought back from early breaks in both sets but ultimately came up short on the key points in a performance that saw her commit six double faults and lose five service games to her 20-year-old opponent.
"I knew (Sharapova) would fight for everything because I've watched her since I was little," world number 44 Osaka said in a courtside interview after winning the first meeting between the pair. "I was just really honoured to play her."
A two-time champion at Indian Wells, Sharapova won the Tianjin Open in October for her first triumph since returning to the WTA Tour, but has not come close to challenging for a tournament victory since.
In earlier action, American teenager Amanda Anisimova recorded her first top-level victory with a 6-2 6-2 thrashing of Pauline Parmentier.
The 16-year-old's poised and polished performance came in stark contact to the dismal display of Canadian Eugenie Bouchard, who was humbled 6-3 6-4 by American qualifier Sachia Vickery.
Anisimova, the junior women's U.S. Open champion, was stronger than the 32-year-old Parmentier in every facet of the game on the slow hard court in Indian Wells.
"It's very exciting. I've worked really hard for this so I'm proud of myself," Anisimova told Tennis Channel, adding that adjusting to the senior ranks had been more mental than physical.
"The biggest thing is being tough mentally. I've learned about how to just be stronger during matches."
She will face Russia's 23rd seed Anastasia Pavlyuchenkova in the second round.
Switzerland's Belinda Bencic, who was also a teenage prodigy but has had her career blighted by injury, also advanced by overcoming an awful start and seeing off a match point to beat Hungarian Timea Babos 1-6 6-1 7-6(4).
Former world number five Bouchard was outclassed by 100th-ranked Vickery in her first match since reaching a settlement with the U.S. Tennis Association (USTA) over a locker room fall during the 2015 U.S. Open.
Her weak second serve was particularly costly as Vickery pounced time and again in front of a sparse late-afternoon crowd on centre court.
All eyes will be on Serena Williams on Thursday when the American plays in her first singles event since giving birth last September, the two-time champion starting her campaign against Zarina Diyas of Kazakhstan in a first round encounter.