The world number one, who has recently been suffering with an ankle injury, lost the first set but came back to see off his Russian opponent 4-6 6-1 6-4 on Wednesday.
"Today was a big test," Sky Sports News quotes Djokovic as saying. "I had a great quality opponent.
"I'm very happy to win, I'm just happy to compete, to be honest. I didn't know if I'm going to be playing the tournament up to yesterday (Tuesday) basically."
Djokovic will take on 14th seed Juan Monaco in the next round with a quarter-final spot awaiting the winner.