The defeat was just the fifth time in the past decade former world number one Djokovic has lost against a player outside the top 100 players in the world.
Also through to the third round are Roger Federer, who beat Federico Delbonis 6-3 7-6 (8/6) in one hour and 43 minutes, while Juan Martin Del Potro took just under 70 minutes to beat Australian Alex de Minaur 6-2 6-1.
The American-born Japanese player won the first set on a tie-breaker, before losing the second set 6-4 to Djokovic.
Holder Roger Federer avoided the same fate as Djokovic, though the Swiss top seed was pushed hard by Argentine Federico Delbonis in a match that was completed on Sunday after being halted by rain on Saturday.
Federer is making his 17th appearance in the California desert and is assured of remaining world No 1 if he makes it to the semi-finals.
The 34-old, who has seven career titles, pounded down 12 aces, including six in the deciding set.
By virtue of the win, Federer moved on to the third round where he will face No. 25 Filip Krajinovic for a spot in the round of 16.
Trump's tariffs show you get what you voted for
Overall, America buys more goods from overseas than foreigners buy from us, but dominates in service industries , like technology. That scenario, Tom Donohue said, would endanger the economic momentum from the GOP tax cuts and Trump's rollback of regulations.
Djokovic will now be hoping for a better showing at the next ATP Masters event he is scheduled to play in a few days time, the Miami Open. "But I recovered very quickly, and I got myself ready", said Djokovic.
On his highly-anticipated return to the tour after right elbow surgery, Djokovic looked a shadow of his former self.
In their only other ATP meeting in 2013, Delbonis won on clay in Hamburg 7-6 (7), 7-6 (4).
Djokovic took six months off after Wimbledon a year ago and returned at January's Australian Open, where he lost in the fourth round.
Federer said he understands well how even a champion like Djokovic could be struggling to find his game so soon after having surgery. You know, I felt really good.
"It is still early stages for Novak coming back and the first one after surgery". He's only going to get better from here.
Jack Sock, David Ferrer, Marin Cilic were also winners along with Gael Monfils who edged John Isner and Milos Raonic who ended the run of Canadian countryman Felix Auger-Aliassime 6-4, 6-4.