Federer - the defending champion and a five-time victor of this event - required less than an hour on Stadium 1 to get the better of the Serbian world number 28.
The storm clouds rolled in just before the start of their match on Saturday and after a short delay to start the first set they managed to play until the heavy rains came in the second.
He extended his 2018 win streak to 13 matches and has only dropped three sets from 34 played this year.
Roger Federer (SUI) during his third round match against Filip Krajinovic (not pictured) in the BNP Paribas Open at the Indian Wells Tennis Garden.
Federer and 10th seed Djokovic both came into the tournament seeking to become the first six-time victor of the event. "For me it felt like first match I ever played on the tour", Djokovic said after his defeat, as quoted by ATP's official website.
In other matches, Borna Coric of Croatia upset No. 13 Roberto Bautista Agut of Spain 6-1, 6-3; Jeremy Chardy beat No. 20 Adrian Mannarino 7-5, 4-6, 6-1 in an all-French matchup; and No. 11 Pablo Carreno Busta of Spain defeated Daniil Medvedev of Russian Federation 6-1, 7-5.
"Very weird. I mean, I just completely lost rhythm, everything".
Japan's Daniel won the first set on a tie-break before Djokovic, making his return from an elbow injury, took the second.
Djokovic took six months off after Wimbledon past year and returned in January's Australian Open where he lost in the fourth round.
A lot was expected of Djokovic, but the Serb was rusty and made 61 unforced errors in the match against Daniel that lasted two hours and 30 minutes.
Spanish 11th seed Pablo Carreno Busta defeated Daniil Medvedev 6-1 7-5 but 13th-seeded Roberto Bautista Agut was dismantled 6-1 6-3 by 21-year-old Croatian Borna Coric.
Another surprise victor was Cyprus' Marcos Baghdatis, who beat Argentina's Diego Schwartzman, who is seeded 14th, 7-5, 6-4.