Djokovic took a medical timeout during the second set and appeared distinctly uncomfortable, grimacing and stretching, but he avoided joining Rafael Nadal and Casper Ruud in making an early exit, coming through 6-1 6-7 (5) 6-2 6-0 to set up a clash with Grigor Dimitrov.
Speaking to Eurosport afterwards, the 35-year-old said of the hamstring: "To be honest, it is not good at all. I will take it day to day.
"It was better last match, the feeling, than tonight, but that is all I can say and now it is up to God to help me and the physio and everyone. I hope I will be able to recover and be ready for a tough match next up."
Expanding on the subject in his press conference later, Djokovic said: "I am worried. I cannot say that I'm not. I have reason to be worried."
Djokovic also had an animated discussion with the umpire over the antics of a drunk fan who was heckling him, calling for the man to be thrown out, which duly happened.
"The guy's drunk out of his mind," Djokovic said to Fergus Murphy. "From the first point he's been provoking me. He's not here to watch tennis, he just wants to get in my head."
The Serbian came into the tournament with the injury having sustained it playing in Adelaide a fortnight ago.
He eased through his first-round match against Roberto Carballes Baena and said afterwards that his leg was improving, and there appeared to be no alarms in the first set, with Couacaud the cause for concern after rolling his ankle.
But, during the second, Djokovic started to show signs he was feeling the injury, calling for the trainer at 4-5 and heading off court.
The Serb has a reputation for managing apparently miraculous recoveries from physical ailments, winning the title here two years ago after tearing an abdominal muscle for example, but he was certainly not moving anywhere near his normal levels and pulled up several times while running.
He managed to find a way through this one despite losing a second-set tie-break he seemed to be in control of, but there must be serious question marks about his chances of winning a 10th title in Melbourne.
Ruud, meanwhile, admitted a lengthy exhibition tour with Nadal may have compromised his chances following his 6-3 7-5 6-7 (4) 6-2 defeat by American Jenson Brooksby.
The second seed, a finalist at the French Open and US Open last year, had limited pre-season training after joining Nadal on a tour of Latin America lasting nearly two weeks.
The Norwegian said: "It's very easy to sit here now and say that was bad for maybe both Rafa and I due to the fact that we lost early here.
"(The preparation) was maybe not enough to be able to perform well here this year. So it will be considered by me and my team what we will do in December this year, and if this was the right way to prepare for the Australian Open or not.
"Maybe it looks like it was not the right way, but there are many factors that come into play."
Ruud struggled from the start with the unorthodox style of 22-year-old Brooksby, who is named after former British racing driver Jenson Button.
Brooksby missed three match points serving for the biggest victory of his life in the third set but recovered impressively in the fourth.
He raised weary arms in the air, and then said: "I was really proud of the mental resolve after the third set didn't go my way."
It has been a hugely successful tournament so far for the American men, with eight through to the third round.
Tommy Paul, JJ Wolf and Michael Mmoh all upset seeds, with the latter taking out 12th seed Alexander Zverev, who is finding things tough after returning from a long-term ankle injury.
Ben Shelton, who is on his first trip outside the US, is also through to the last 32 but America's highest-ranked man, eighth seed Taylor Fritz, is out after losing in five sets to Australian wild card Alexei Popyrin.
Roberto Bautista Agut fought off a fine challenge from another young American, Brandon Holt, recovering from two sets down, while fifth seed Andrey Rublev, ninth seed Holger Rune and big Australian hope Alex De Minaur are also through.