Federer, seeded fifth, lost 3-6, 7-5, 6-4 to Japanese 20th seed Kei Nishikori.
Nishikori booked a semifinal showdown with former world number one Djokovic, who defeated Murray 7-5, 6-3 on the hard courts at Crandon Park.
"Kei did well to stay with me and not allow me to hold my serve," Federer said on Wednesday.
"He was more consistent in the second and third set and those are the ones he won,” the Basel native said.
“At the end, it's his credit."
Nishikori reached his second Masters semi and first in 2 1/2 years by winning the two hour, nine minute night match.
"I thought I really played well, especially in the third," Nishikori said.
"I was hitting both deep and striking well — everything was going well.
"There was couple of tough moments, but I was fighting through and happy to win today."
Nishikori next faces Djokovic, who is going for back-to-back Masters titles after his triumph at Indian Wells against Federer.
They split their only two previous matches with Djokovic winning 6-1, 6-4, 6-4 at Roland Garros in 2010.
They also played on the hard courts three years ago in Switzerland where Nishikori won in three sets, 2-6, 7-6 (7/4), 6-0.
Nishikori blasted six aces and won 64 percent of his first serve points against Federer.
He has now won two of three career meetings against Federer.
The Japanese also won their last encounter on clay in Madrid in 2013, 6-4, 1-6, 6-2.
Nishikori was broken twice in the second set but managed to break right back. He tried to take advantage of Federer's poor serving on Wednesday.
"He wasn't making a lot of first serves today," Nishikori said.
"Maybe because of the wind," he said.
"I was trying to step in his second serve, and my return was going well.
"That was the key for the game today."
Federer, the recent Dubai champion, has previously won in Miami in 2005 and 2006.
He had three double faults and seven aces against Nishikori.