The German two-times Grand Slam champion suffered defeat only a week after being forced to quit while trailing Eugenie Bouchard in Madrid.
Kerber arrived in Rome on Sunday ready to play in the last clay-court event before Roland Garros begins on May 28.
"It feels great," said Estonia's Kontaveit. "It's my first time beating the No.1 in the world, so, you know, I'm super excited."
Assuming she is fit, 29-year-old Kerber, who returned to the top of the rankings ahead of the pregnant Serena Williams, will be one of the main favourites to win in Paris.
Her previous best run at the clay-court slam was a quarter-final appearance in 2012.
"Everybody knows I'm not a clay court specialist," said Kerber. "I was not playing good last year, as well. I had a great year, but I mean, these few weeks I was not playing good.
"I think I need one good match to get also my confidence back and then to seeing that it works, actually. Because I'm working hard, I'm trying to practice really hard and trying to improving the movement, especially on clay, because it's not 100%.
"I'm not feeling so well on this surface."
Fourth seed Dominika Cibulkova of Slovakia was also a surprise casualty, going down 1-6 6-1 6-3 to Russia's Ekaterina Makarova.
There was no such drama for number two seed Karolina Pliskova, however, as the Czech player beat American Lauren Davis 6-1 6-1 to take her place in the last 16.
Third seed Garbine Muguruza Blanco of Spain is also through after beating Latvia's Jeļena Ostapenko 2-6 6-2 6-1.
Venus Williams saw off Lesia Tsurenko of Ukraine in straight sets, 6-4 6-3, and the American will next face Johanna Konta, the British world number six.
However, 14th seed Barbora Zahlavova Strycova is out after the Czech lost 6-4 6-2 against Timea Bacsinszky. The Swiss will next take on Pliskova for a place in the quarter-finals.
Earlier on Wednesday, number six seed Simona Halep of Romania beat German Laura Siegemund 6-4 6-4 and Elina Svitolina, the eighth seed from Ukraine, defeated France's Alize Cornet 6-4 7-6 (13/11).
Holland's 15th seed Kiki Bertens is also through after beating Catherine Cartan Bellis of the United States 6-4 6-0, while 12th-seeded Russian Anastasia Pavlyuchenkova beat Latvia's Anastasija Sevastova 7-6 (7/4) 6-2.
Results from the Italian Open Women's Singles Round 2 matches on Wednesday
- Ekaterina Makarova (Russia) beat 4-Dominika Cibulkova (Slovakia) 1-6 6-1 6-3
- 9-Venus Williams (U.S.) beat Lesia Tsurenko (Ukraine) 6-4 6-3
- Timea Bacsinszky (Switzerland) beat 14-Barbora Strycova (Czech Republic) 6-4 6-2
- Anett Kontaveit (Estonia) beat 1-Angelique Kerber (Germany) 6-4 6-0
- Julia Goerges (Germany) beat Jelena Jankovic (Serbia) 2-6 7-6(2) 6-1
- Daria Gavrilova (Australia) beat Caroline Garcia (France) 7-5 3-6 6-3
- 12-Anastasia Pavlyuchenkova (Russia) beat Anastasija Sevastova (Latvia) 7-6(4) 6-2
- 2-Karolina Pliskova (Czech Republic) beat Lauren Davis (U.S.) 6-1 6-1
- 8-Elina Svitolina (Ukraine) beat Alize Cornet (France) 6-4 7-6(11)
- 6-Simona Halep (Romania) beat Laura Siegemund (Germany) 6-4 6-4
- Mona Barthel (Germany) beat Wang Qiang (China) 6-3 6-4
- 15-Kiki Bertens (Netherlands) beat Catherine Bellis (U.S.) 6-4 6-0
- 3-Garbine Muguruza Blanco (Spain) beat Jelena Ostapenko (Latvia) 2-6 6-2 6-1