Despite his Olympics triumph in London last month, Murray was the underdog heading into Monday night's match having lost in four consecutive finals in a major tournament.
He looked to be in the ascendancy after taking the first two sets - both by narrow margins.
But world number two Djokovic stormed back and emphatically took the next two sets to level and send the encounter to a decider.
However, Murray showed tremendous character in the fifth to seal a 7-6 (12/10) 7-5 2-6 3-6 6-2 victory.
"Right now, there's a lot of relief and I'm still buzzing a bit from the match - the atmosphere out there was unbelievable," he told Sky Sports 1.
"It would have been a tough one to lose so I'm so, so happy I managed to pull though in the end.
"The body's hurting a bit but it was worth it."
Watch: Murray claims first Grand Slam title... More Videos
The windy conditions helped Murray in the early stages but Djokovic fought back once it had started to die down.
However, the Scot revealed he took a toilet break before the start of the decider to regain his composure.
"The wind calmed down towards the end of the second set and I had to change the way I was playing a bit because he was then dictating more of the points and he started going for it a bit more.
"I was still playing the same way as when it was windy and I was kind of guiding the ball a little bit and was only reaching the middle of the court.
"At the beginning of the fifth set I went to the toilet and I said to myself: `For one set, just give it everything you've got`.
"I got lucky in the first game with a net on the break point but I settled down after that."
Murray admitted there have been moments when he questioned whether he would ever lift a grand slam title, pointing to his loss to Roger Federer at Wimbledon this year - his fourth loss in a grand slam final.
And the 25-year-old believes his task of winning a major was made more complicated by the fact he was regularly competing against three of the greatest players of all time - Roger Federer, Rafael Nadal and Djokovic - in the latter stages.
He said: "There were times, after Wimbledon this year, for a few days afterwards where you think: "Is it ever going to happen?"
"Competing against some of the best players of all times makes it harder.
"I don't want to be disrespectful to any other players but when Federer won his first slam it was against (Mark) Philippoussis, who had also never won one, Rafa against (Mariano) Puerta, who had never won one, and Djokovic against (Jo-Wilfried) Tsonga.
"When I've been in slam finals they've been against Roger, who's one of the greatest players ever, and also against Novak so it's been incredibly tough for me mentally and there's no easy matches.
"I just managed to fight through in the end today and hopefully I can push on from here."
Murray emulated coach Ivan Lendl by winning in a grand slam final at the fifth attempt and the world number four believes the Czech is a key member of his team.
"He's been in that position a lot of times before," said Murray.
"He said to me to enjoy it and I said to him: "I'm going to try".
"But I was really nervous today, more nervous than I had been before Wimbledon and before the Olympics.
"I didn't say much for two hours before the match. I was quite quiet and the locker room was completely deserted and you're on your own a lot and you're thinking a lot.
"It's great to have him there because he's been there and done it."
He was also quick to thank the rest of his team, adding: "They've seen me lose some tough matches but they've always believed in me, they've always been there when I've needed their support.
"I've been through a lot of tough moments away from the court, physically, the stuff we do in the gym, they've seen the work I've put in and how hard we've worked as a team to get to this stage."