Djokovic, who lost to John Isner in the semifinals here a year ago, held serve for a 5-2 lead in the final set, then had a pair of match points after a crisp forehand to the corner.
Fognini saved the first match point, but lost both his serve and the match when he hit a seemingly easy backhand into the net.
Djokovic blamed himself for the second-set loss.
''One thing is for sure,'' he said. ''When you win 6-0 first set you need to be a little extra focused for the start of the second because the player will definitely change something in his tactics, in his game and will try to come back. That's what happened.
''He's a good player on this surface. He made me work. He made me earn my points. But in the end I have done what I need to do. The W is there, so I feel good about myself.''
Andy Murray earlier earned a 5-7, 6-2, 6-2 win over Evgeny Donskoy of Russia.
Murray, the No. 3 seed at the $10 million event, had lost his opening match at the Indian Wells Tennis Garden in each of the past two years.
He said he had no explanation for those results, but that he hadn't felt any different Sunday than he had a year ago, with one exception.
''I have not played a match for five weeks (since losing the Australian Open final to Djokovic on Jan. 27) so you can't expect to play your best tennis straightaway,'' Murray said.
''He started off well and I started off slowly. Even once I got back into the match at 5-all (after being down 5-1 in the first set) he played some good stuff. Once I got into a rhythm, I was able to dictate more of the points.''
Women's No. 2 seed Maria Sharapova followed Murray onto Stadium Court and advanced to the fourth round with a 7-5, 6-3 victory over Carla Suarez Navarro of Spain.
''I thought it was a tough one,'' said Sharapova, whose fourth-round opponent will be Lara Arruabarrena-Vecino of Spain, who beat No. 14 Roberta Vinci of Italy 2-6, 6-4, 6-4.
''She's (Suarez Navarro) a quality player. She has a really solid game, a lot of variety, but she can hit the ball as well. There are a few things I want to improve on for the next match, but I was happy I got through on not a great day.''
Sunday night, No. 8 seed Jo-Wilfried Tsonga of France beat wild-card entry James Blake of the U.S. 7-6 (6), 6-4; No. 9 Marion Bartoli rallied from a 4-0 first-set deficit to beat Svetlana Kuznetsova 6-4, 6-3; No. 23 Sam Querrey toppled Ivo Karlovic 6-3, 6-4, and No. 5 Petra Kvitova ousted qualifier Lesia Tsurenko 6-2, 7-6 (5).
Also, Mardy Fish of the United States earned a 6-3, 3-6, 6-4 win over Bobby Reynolds.
Fish played his first competitive match of the year after not playing since last September because of a heart condition.
''It's been a tough few months, for sure. You sort of feel like it was a win just to go back out there,'' Fish said.
''There's a lot of people that have sort of dealt with what I've dealt with and not come back. It's nice to just play, first and foremost, and then you get out there and you want to win.
''You want to stay within yourself a little bit and not get too fired up or too low or too high or anything like that. Then all of a sudden you find yourself in the third set, you know, deep in the third set losing (4-2), and some of that sort of fight starts kicking in and you want to win.
''I certainly didn't expect to win so soon. The tennis side of it hasn't been an issue. I have been playing for quite a while now, as far as months are concerned, but just competitive matches, you can't duplicate those.''
Fish lost only three points in winning the final four games.
He hasn't disclosed the precise nature of his problem because ''it's not something that's very easy to talk about.''
''I'm going to play Miami (next week),'' he said, ''and then I'm going to assess it after that, Maybe step back and see how I feel, where I am personally, see after these two weeks if it's something I can still do at a high level. That will certainly be a question I'll ask. Hopefully I'll resume sort of a normal schedule, but we'll see.''
In other men's matches, No. 7 Juan Martin del Potro of Argentina ousted Nikolay Davydenko of Russia 6-3, 6-4; No. 19 Tommy Haas of Germany beat Pablo Andujar of Spain 6-3, 7-6 (0); Marinko Matosevic of Australia upset No. 14 Juan Monaco of Argentina 7-5, 6-0; Bjorn Phau of Germany beat No. 25 Jeremy Chardy of France, 6-2, 2-6, 6-4; No. 12 Marin Cilic of Croatia overcame Albert Ramos of Spain, 7-6 (7), 6-2; Carlos Berlocq of Argentina upset No. 22 Alexandr Dolgopolov 6-3, 6-7 (5), 6-3; Nicolas Almagro (11) of Spain topped Daniel Gimeno-Traver 7-5, 6-1; and Yen-hsun Lu of Taiwan beat No. 26 Martin Klizan of Croatia, 7-6 (5), 7-6 (5).
Kei Nishikori of Japan, the 16th seed, beat qualifier Philipp Petzschner of Germany 6-3, 6-2.
In other third-round women's matches, No. 6 seed Sara Errani of Italy won in straight sets over Johanna Larsson of Sweden 6-3, 6-1; No. 13 Maria Kirilenko of Russia beat American qualifier Mallory Burdette 6-3, 4-6, 6-2; and No. 19 Klara Zakopalova of the Czech Republic beat No. 12 Dominika Cibulkova of Slovakia 6-4, 7-5.
Third-seeded Agnieszka Radwanska of Poland was a 6-7 (5), 6-3, 6-4 winner over Sorana Cirstea of Romania.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)