Djokovic made a sluggish start in his first match since losing to Roger Federer in the Wimbledon semi-finals, but he was eventually able to find enough momentum to see off the world No 65 in a rain interrupted first round tie on Court One.
After winning a bronze medal at the 2008 Games in Beijing, Djokovic is keen to bring home gold this time, but the 2011 Wimbledon champion, who faces Andy Roddick or Martin Klizan in the second round, must improve on a performance which featured 23 unforced errors.
The match was delayed by nearly three hours due to persistent rain and Djokovic seemed more affected by the long wait during a tight first set.
The 25-year-old broke for 5-3 lead but then carelessly dropped his own serve as he tried to close out the set.
The tie-break was delicately poised at 7-7, with both players having wasted set points, when the rain returned to force another lengthy delay.
Djokovic, the reigning US and Australian Open champion, seemed caught cold immediately after the resumption and Fognini took full advantage, snatching the two points needed to take the set.
But, with a shock exit suddenly on the cards, Djokovic managed to raise his game considerably in the second set.
He landed an early break and pressed home his advantage with one more break to set up a deciding set.
Djokovic was in the mood now and he unloaded some searing groundstrokes to break in the opening game before serving out a hard-fought win.