The Serbian star led a parade of the top four seeds into the last eight of the tournament.
The Serbian star led a parade of the top four seeds into the last eight, with second-seeded Rafael Nadal, number three Marin Cilic and fourth-seeded defending champion Dominic Thiem all advancing.
Top-seeded Djokovic, back in action this week for the first time since his shock second-round exit at the Australian Open in January, had to dig deep against former US Open champion del Potro after falling a break down in the third set.
He broke back immediately to level the set at 4-4 then held at love to pile the pressure on del Potro -- who fended off one match point with a service winner but couldn't hold off Djokovic on the next.
"Every match that I’ve played against delPo in the past couple of years has been very close, really enjoyable to play and great for the crowd to watch,” said Djokovic. "I am very happy and proud to win this match, even though I was close to losing when he was serving at 4-3 up in the third set.
"I just tried to get as many returns back in play as possible."
The Serbian advanced to a quarter-final clash with Australia's Nick Kyrgios, a 6-2, 6-4 winner over American Donald Young.
Djokovic's travails in a match lasting two hours and 38 minutes were a far cry from Nadal's comprehensive 6-1, 6-1 victory over Paolo Lorenzi.
”I played a complete match today and I'm feeling great after a month without playing," said Nadal, a two-time winner in Acapulco who is playing his first tournament since falling to Roger Federer in the Australian Open final.
"I think I played a very solid match ... some great shots, some good winners," added the Spaniard, who dropped just seven points on his serve and never faced a break point against the 38th-ranked Italian.
Nadal broke Lorenzi for the fifth time in the final game of the match, delivering a stinging forehand winner to wrap up the win in just 66 minutes.
Nadal next faces Japanese qualifier Yoshihito Nishioka, a 6-4, 3-6, 6-0 winner over Australian lucky loser Jordan Thompson.
Cilic booked his quarter-final berth with a 6-3, 2-6, 6-3 victory over fellow Croatian Borna Coric.
Cilic, the 2014 US Open champion, remained unbeaten against his 20-year-old compatriot.
He fired a dozen aces, and broke Coric three times in the match -- including twice in the final set to set up a clash with American Steve Johnson, a 7-6 (7/5), 6-3 winner over American wildcard Ernesto Escobedo.
Austria's Thiem advanced with a 7-5, 6-3 victory over Adrian Mannarino.
Thiem, winner at Rio de Janeiro last week, booked a meeting with American Sam Querrey, who toppled fifth-seeded Belgian David Goffin 6-2, 6-3.