The world No. 1 defeated Fabio Fognini 6-0, 5-7, 6-2, the struggles he encountered against the 36th-ranked Italian echoing world No. 3 Andy Murray's battle to a 5-7, 6-2, 6-2 victory over unheralded Russian Evgeny Donskoy.
Djokovic improved to 14-0 in 2013, but he was kicking himself for letting control of the match slip away in the second set, when he went up an early break only for Fognini to get back on serve with a break of his own in the seventh game.
"It was definitely a difficult challenge today," Djokovic said. "Fabio played well towards the end of the second set, but it was all my fault. I had a break for 4-2 up and I played a terrible game.
"After that it was very even. It could have gone either way."
Fognini saved a match point with a service winner in the the 10th game of the second set and broke Djokovic in the 11th.
He duly served out the set, and had Djokovic under pressure in the opening game of the third, when the Serbian fended off one break point then battled through four game points and an irksome time violation before finally holding serve.
From there Fognini began to fade. Djokovic broke him to lead 3-1 and broke him again to secure the win.
Djokovic said his difficulties hadn't dented the confidence gained from capturing his fourth Australian Open crown in January, and a fourth ATP Dubai title last week.
"I'm not concerned," Djokovic said. "I know I have been in this situation before where I had minor setbacks in a match, especially in the opening matches where I'm trying to get used to the court, the conditions, so forth.
"In the end, I have done what I needed to do. The 'W' is there, so I feel good about myself."
Murray, playing his first match since falling to Djokovic in the Australian Open final, quickly found himself down 5-1 to Donskoy -- ranked 83rd in the world.
Although the slow start raised unwelcome memories of his first-match exits here in each of the past two years, Murray won four straight games to level the set.
However, he was unable to convert any of six break chances in the 11th game and Donskoy broke him for a third time in the 12th game to pocket the set.
Murray, however, had found his range and made short work of the second and third sets.
Seventh-seeded Argentine Juan Martin del Potro had little trouble in a 6-3, 6-4 victory over Russian veteran Nikolay Davydenko, but eighth-seeded Jo-Wilfried Tsonga of France had to fight past determined US wild card James Blake 7-6 (8/6), 6-4.
Tsonga squandered four set points in the 12th game of the opening set, then had to fight off three set points for Blake in the tiebreaker.
Blake saved two match points against his serve in the ninth game of the second set before Tsonga closed it out with a love game.
It was a bit of a slog for the top women as well.
Second-seeded Russian Maria Sharapova had to battle back from an early break in each set to earn a 7-5, 6-3 third-round victory over Spain's Carla Suarez Navarro.
"I thought it was a tough one," Sharapova said. "She's a quality player, capable of playing some really good tennis. She's beaten top players in Grand Slams before and has a really solid game with a lot of variety.
"There are a few things I want to improve on, but I was happy I got through on not a great day," she added.
Third-seeded Agnieszka Radwanska of Poland dropped a first-set tiebreaker but rallied for a 6-7 (3/7), 6-3, 6-4 victory over Romanian Sorana Cirstea.
Fifth-seeded Czech Petra Kvitova, the 2011 Wimbledon champion, had slightly less trouble emerging with a 6-2, 7-6 (7/5) victory over Ukrainian qualifier Lesia Tsurenko, while sixth-seeded Italian Sara Errani sailed through, defeating Sweden's Johanna Larsson 6-3, 6-1.