The Serbian world number two fought back from the dead to beat the Scot 5-7 7-6(11) 6-3 and prevent Murray from winning the title for a third successive season.
Murray served for the match in the second set, earning a match point as he did so, and had four more chances to close out the match in the 24-minute tie-break that followed.
But it was Djokovic who came through, growing stronger throughout as Murray appeared increasingly tired, the Serb avenging his defeats by the Scot in both the Olympics and the US Open this summer.
"It was a thrilling match...very long - three-and-a-half hours for best of three is quite long. But I have got used to it," Djokovic said.
"Whenever I play Andy I know it's going to be a gruelling fight, a lot of long rallies. It could have gone either way.
"I could not say I dominated the match because all three sets were very close and he had some match points and opportunities to finish the match. I could have easily been a runner-up today but I'm very proud of my fight."
In the early stages the Scot took charge of the match as he came out on top of a thrilling and wildly fluctuating first set that saw seven breaks of serve.
The last of those proved most telling as Djokovic lost the 11th game of the set from 40-0 ahead - prompting the Serb to smash his racquet to pieces on the court - before Murray served out for the set.
With both players somehow finding their timing on serve between the sets the match then became a much cagier affair.
But it was Murray who grabbed the first break opportunity as Djokovic lost concentration while serving at 3-3, gifting Murray two break points.
The world number three grabbed the opportunity at the first time of asking, and as the rest of the set right up until the point that he stood at match point, at 40-30 and 5-4 ahead.
Yet Djokovic was not done: he saved the match point by hitting a wonderful shot between his legs before charging the net to force deuce with a dreamlike drop shot, earned a break point with a winner into the corner on the next point and was then the beneficiary as Murray blasted a simple forehand long with the court at his mercy.
The set then headed for a tie-break which proved to be just as epic as their tie-break at the US Open last month. Both players had several chances to win it, and each missed shots under pressure to let the set out of their grasp, but it was Djokovic who held his nerve to win it 13-11.
This time it was Murray's turn to destroy a racquet in bitter frustration, an understandable release of tension having seen five match points slip through his fingers.
The anger of the world number three did not help him, however, with Djokovic forcing him to deuce on each of his first three service games in the final set.
And the breakthrough came in the seventh game as Murray slipped 15-40 down tired, sloppy fashion as he hit three successive shots long under no pressure at all, before conceding the break by netting with a simple forehand on the very next point.
That left Djokovic in control of both set and match, and after holding serve he then broke a tired-looking Murray once again to bring the three hour 20 minute match to a close.