He won the first set, but the defending champion took the next three in a row to claim victory in their last-four tie.
Djokovic will now play Nick Kyrgios after the Australian was given a walkover when Rafa Nadal retired from the tournament through injury.