Having lost the first set, the subdued world number three served at 5-4 in the second, only to go on to lose 7-5.
A string of unforced errors also piled up as the 16-time Grand Slam winner was beaten by the Serbian for the 12th time in his career.
"I thought he played well under tough conditions," said Federer. "I wasn't able to sustain maybe a solid enough game today. I did have enough chances, so it's no excuse there. I tried, and it just didn't work out today.
"Semi-finals is, at the end of the day, a very good result for any tennis player. For me, too. I wish I could have done a bit better today, especially with the wasted opportunities, but that's how it goes sometimes."
World number one Djokovic will take on defending champion Rafael Nadal in Sunday's final.