Trailing 2-0 in the third set, Osaka fought off three break points to hold and begin a run of six straight games to close out the match in just under two hours. She broke Stephens three times in the set, including at love in the sixth game.
"That was a really good test for me," Osaka said.
Cold winds blowing from 20 to 30 mph sent debris swirling around the court.
"I felt like I was fighting for my life. I was fighting against her, I was fighting against the wind. It was crazy," Osaka said. "I'm really proud with how I handled it."
Osaka, the 2018 winner at Indian Wells, is back in the desert for the first time since 2019. The Japanese star hadn't played a tournament since January when she lost in the round of 32 at the Australian Open. Having played only a handful of events last year, her ranking has dropped to 78th in the world.
"I keep taking these long breaks," she said. "I do need to play a lot more matches and I do need to give myself the opportunity to get more into the swing of things."
Osaka has said she has faced bouts of depression since winning the US Open in 2018. The four-time major champion withdrew from the French Open last year to preserve her mental health.
Stephens, the 2017 US Open winner, lost for the first time in three career meetings with Osaka. The American's ranking has dropped to 38th, although she was coming off a win in the tournament at Guadalajara, Mexico, last month.
Other first-round winners were Yulia Putintseva, Daria Saville and Tereza Martincova. Shelby Rogers, an Indian Wells quarterfinalist last year, needed nearly three hours to get by Nuria Parrizas Diaz 6-1, 5-7, 7-6 (3).