Djokovic, who has won all three majors this year, fought back to win 1-6 6-3 6-2 6-2 over world number 99 Brooksby.
“It was a good finish. It wasn’t a good start,” Djokovic said after the hard-fought win.
“But all in all, expected the battle, and I got that one. I’m pleased to overcome it.”
Djokovic progresses to the quarter-finals where he will face sixth seed Matteo Berrettini as he chases a rare calendar grand slam.
“Next to del Potro, (Berrettini is) probably the hardest hitter of serve and forehand,” Djokovic said.
“He’s got the lethal-serve-plus-one game. He’s already established as a top player. Without a doubt, he played a couple of I think semi-finals here couple years ago, finals in Wimbledon. That was a tough four-setter.
“If he serves well, which is his biggest weapon, he’s tough. He’s tough on any surface to play against. I’ve had some really close matches with him in French Open and Wimbledon recently.
“We’re going to play the third Grand Slam in a row against each other. Hopefully the result will be the same like the previous two.”
Berrettini overcame German Oscar Otte in four sets to secure his spot in the last eight.
Elsewhere, Alexander Zverev continued his hot form with a straight-sets win over 13th seed Jannik Sinner while Lloyd Harris beat American 22nd seed Reilly Opelka in four sets.
