Djokovic defeated Federer 3-6, 6-3, 7-6 (7/3) to capture his third title in the California desert to go with those he won in 2008 and 2011.
In the 33rd career meeting between the tennis heavyweights, Djokovic avenged a loss to 17-time Grand Slam champion Federer in the semi-finals last month at Dubai.
Federer earned his first title in nine months in Dubai and will rise from eighth to fifth in the world on the strength of reaching the Indian Wells final.
Trailing in the final set after dropping his serve in the third game, Federer finally clawed back the break in the 10th game to knot the set.
From there they went to a tiebreaker that was all Djokovic. Federer sent a backhand long on the first point of the breaker, and Djokovic seized a quick 3-0 lead with an overhead smash off a weak Federer lob and another errant backhand from the Swiss.
Federer saved one match point with an ace, but Djokovic ended it on his first opportunity on his own serve when Federer smacked a backhand into the net.