Yet it only prompted Djokovic to increase his focus and produce some supreme play to turn the tide and prevail 4-6 6-2 6-3.
In their 47th meeting, the Serb took the match 7-6 (8-6) 5-7 7-6 (7-3) in three hours and two minutes.
Should he win the title on Sunday, Djokovic will equal Nadal's record of 33 Masters triumphs. There are too many reasons that motivate me to keep playing.' Federer was asked about how he manages to play even if being injured: 'Dealing with little niggles is normal.
It means Djokovic will contest his fourth final in a row after a stunning run of form in the latter half of 2018 and now leads Federer 25-22 in career head-to-head.
'I'm just pleased to be in the semis, and I know I can play better'.
An engrossing first set saw Federer save four break points in the eighth game, which featured a quite brilliant overhead from the Swiss after a Djokovic passing shot caught the top of the net and threatened to hit him in the face.
The missed opportunity proved costly when Federer conjured up just a second break point of the contest at 6-5, converting in style as he gambled on Djokovic going cross-court before batting a victor down the line to force a decider.
The 22-year-old, 6ft 6in Russian, already the owner of two indoor hard court titles this year, moved one step away from the biggest title of his career, crushing his Austrian friend and practice partner in 70 one-sided minutes.
Both served commandingly in the final set and the only anti-climax was the final tie-break in which Federer was error strewn and Djokovic showed no mercy.
The world number 18, who needed just over an hour to beat Zverev, will face Dominic Thiem in the semi-finals.
Djokovic reeled off six successive points to bring up five match points, clinching victory at the third attempt when Federer picked out the net to end a tense concluding rally.
"I'm really happy to achieve this, to make it to the finals".
"We've had epic matches throughout our rivalry but this one definitely ranks as one of the best matches we played".
The Russian number two now has 15 match wins at this level this year, including a trip to the semi-finals of the Rogers Cup in Toronto.
"It was one of my best matches and what I'm happy about is that I was increasing my level, which shows that I'm becoming a better player", Khachanov, who reached his first Masters 1000 final, said.
Thiem, the French Open finalist, came from behind to win 4-6, 6-4, 6-4 against Jack Sock, who won the title in Paris a year ago.