Daniel came back from a break down to take the first set in a tiebreak, and he limited mistakes in the third to secure the upset.
"I was a little bit exhausted this morning just because the turnaround is always pretty quick", he said.
Daniel had won two rounds of qualifying and then held off fellow qualifier Cameron Norris to book a first meeting with Djokovic. In a stunning performance, the 110th-ranked Yuki, who qualified for the main draw, dispatched the ninth seed Frenchman 6-4, 6-4 in one hour and 19 minutes.
It was another snag in the return for the 30-year-old Djokovic who was playing in just his second event of 2018 after the Australian Open in January.
It was Djokovic's first appearance since the Australian Open after undergoing a minor surgery to fix an ongoing elbow injury, but it lasted just two and a half hours as he was knocked out by the 109 ranked Japanese 7-6, 4-6, 6-1. The 12-time Major victor was beaten in the fourth round of the Australian Open in January after his elbow troubles had kept him out of action since the 2017 Wimbledon Championships.
He won 89 percent of his first service points while cracking six aces to just one double fault.
Novak Djokovic struggled during his second-round match against Taro Daniel.
If the surgery wasn't enough, Djokovic looked like he had been suffering from illness on the eve of Indian Wells.
"I mean, not going to be too down about it", Stephens said.
"And even though you don't have pain, you're still thinking about it, because it's been something that I have been feeling and dragging for over two years".
He will next take on American world No. 21 Sam Querry, who ousted Germany's Mischa Zverev 6-4, 7-5.
In other action, Croatian Borna Coric defeated 13th seed Roberto Bautista Agut 6-1, 6-3.
But that was about as competitive as things got in the third-round match at the Indian Wells Tennis Garden on Monday.