The 38-year-old Serbian battled "brutal" conditions and physical issues during the match, admitting he was "trying to stay alive" on court.
Djokovic extended his record to an 80th ATP 1000 semi-final and became the oldest Masters semi-finalist at 38 years and four months.
He will face qualifier Valentin Vacherot in the semi-finals, who is ranked world No 204.
Vacherot made history as the lowest-ranked player in 26 years to reach an ATP 1000 semi-final and the first from Monaco to reach an ATP Tour semi-final.