Defending champion Djokovic appeared to be heading for a straight sets win in Doha, but Murray saved three match points before taking the tie to a decider.
The Scot had the first opportunity to break in the final set, but he failed to take it, and then could not hold his subsequent service game as his opponent dug in to put himself on course for a 6-3, 5-7, 6-4 success in a match that lasted almost three hours.
Champion Djokovic said: "We both felt like if every match we are going to play against each other is going to be this way this season, we are going to have a fun time.
"This was the best scenario I could ask for for beginning of the season, playing all five matches in this tournament and then three hours against the number one of the world, biggest rival, and winning in a thrilling marathon match.
"It is something that definitely can serve as a positive incentive for what's coming up in Australia."
Murray said at his press conference: "Physically it was a good test to start the year, and I did good there. Obviously I am disappointed not to win tonight, but I played pretty good the last couple of the matches.
"My body feels all right just now, so that's positive. It was a little bit sore earlier in the week after the first couple of the matches, but I felt better each day and I think it is positive.
"I still think there are things I can do better, because I wasn't that clinical on break points this week, which maybe comes with playing a few more matches.
It was a first defeat for Murray following a remarkable run since losing to Juan Martin del Potro when playing for Great Britiain in the semifinal of the Davis Cup in September.
He added: "I still think I have a chance of winning the Australian Open after tonight. I don't think that changes."
Saturday's final was the first meeting between the two players since Murray had overtaken his long-term rival to become world No.1 -- and both began in aggressive fashion.
It was Murray who had the first chance to break, but the impressive Djokovic, who required treatment for a bleeding finger at 30-30 in the third game, shrugged off his minor injury to deny his opponent.
The Serb then won four points in a row to come from 40-15 down in the eighth game and take Murray's serve, before clinching the opening set.
Djokovic, who saved five match points in his thrilling semifinal win over Fernando Verdasco on Friday, then looked set to wrap up the match after breaking Murray again in the second as he built a 5-3 lead.
But the world No. 2 was given a taste of his own medicine as Murray showed superb resilience to stay in the match and win four successive games to level the contest at one set all.
Murray had never beaten the Serb in 19 matches when he had dropped the opening set, but it seemed the momentum could be with him as he looked to end that record. Djokovic, however, found an extra gear and secured the only break of the deciding set in the seventh game to ensure he retained the trophy.