Djokovic has now won all 24 matches he has played this year, the best start to a season since Ivan Lendl began 1986 25-0.
The Serbian, ranked second in the world, has captured four titles, including the Australian Open, Dubai and, now, back-to-back elite Masters titles at Indian Wells and Miami, both with victories over Nadal in the finals.
"It's the best four months in my life, but it's only the start of the season," said Djokovic, who will remain at number two behind Nadal for the time being, even though the Spaniard hasn't won since Tokyo in October.
"It's a bit early to talk about getting that top spot in the rankings," Djokovic said. "Rafa is definitely the best player in the world now."
"If I want to have the number one ranking, I need to play consistently well throughout the whole year."
As in the championship match at Indian Wells a fortnight earlier, Djokovic surrendered the first set to Nadal.
But after a slugfest lasting almost 3 1/2 hours on a steamy stadium court it was Djokovic who emerged the victor, blasting a forehand cross court for the victory on his third match point.
Any fatigue he might have been feeling disappeared with the victory, as Djokovic jumped for joy and an exhausted Nadal headed to his courtside chair.
"What he's doing is unbelievable," Nadal said. "First thing, he's very good. Second thing, he's playing with big confidence."
"The easiest thing to say: He's a very good tennis player."
But Djokovic, who had painted himself as the underdog going in, said he was never sure of the outcome until he had sealed the victory.
"It was such a close match," Djokovic said. "To win against the No. 1 player of the world in a tiebreak in the third set, it's just incredible."
Djokovic added a second Miami title to the one he captured in 2007. And he joined Roger Federer, Andre Agassi and Pete Sampras as the only players to win the Australian Open, Indian Wells and Miami - the three most important early-season events - in the same year.
Nadal seized the early advantage with a break for a 2-1 lead in the opening set - the first time Djokovic had been broke in the tournament.
Nadal broke Djokovic again for a 4-1 lead, but surrendered his own serve while serving for the set in the eighth game.
Two games later, after nearly an hour, Nadal secured the first set.
Djokovic drew first blood in the second, breaking for a 2-0 lead. Despite moments of frustration - including a testy bounce of his racquet after allowing Nadal a break chance - Djokovic held on to claim the second set with an ace.
Both players held throughout the final set, although Nadal applied some pressure when he pushed Djokovic to 15-30 in the final game before Djokovic held on to force the tiebreaker.
The momentum swung Djokovic's way when Nadal delivered his sixth double-fault of the match to fall behind 3-2 in the tiebreaker.
Djokovic won the next three points, giving himself a 6-2 lead and three championship points with a backhand down the line.
On a day when the long rallies left both players panting and Nadal repeatedly changed his sweat-soaked shirt, endurance as well as skill was crucial.
"It was obvious that both of us were slowing down toward the end," Djokovic said. "In the tiebreak, it was really anybody's game. Until the last shot, I didn't know if I was going to win or not."
Nadal finished runner-up in Miami for the third time after falling in the final in 2005 and 2008.
"Maybe I was a little bit more nervous than other days," Nadal admitted. "Maybe because I never won here, and this is the third chance."
Although he wasn't happy with the outcome, Nadal couldn't be unhappy with his effort.
"Nothing left in my body right now," Nadal said. "I love these kind of matches... For sure I love to win, not lose."