Djokovic, who began the year by winning the Australian Open, came from behind in both sets to end Swiss Federer's hopes of a seventh title at the year-ending tournament in London.
The 25-year-old hit back from 3-0 down in the first set and then trailed again in the second before claiming victory after two hours 14 minutes of absorbing action.