Garzelli scored his second stage win in this Giro, edging Spain's Santiago Perez Fernandez, defending champion Gilberto Simoni and fellow Italian Francesco Casagrande in a sprint of a small group in this northern resort.
Friday's fifth leg, from Fossano to Limone Piemonte in the western Alps, marked the collapse of Italy's Marco Pantani, a former Tour of France and Giro winner, who finished 7:02 minutes behind the winner, virtually out of contention for this year's title.
"They are going too fast for me. In this moment I'm not at the same level of the best riders,'' Pantani said after crossing the finish line.
Pantani, the captain of the Mercatone Uno team and a specialist in uphill stages, started in the Giro with a possible doping suspension hanging over his head and did not appear to be in his best form.
Garzelli, a Giro winner two years ago, had captured the pink jersey by winning the second stage in Liege, Belgium, last Monday.
The initial stages of this year's Giro were held in different European countries. Friday's stage, coming after a rest day, was the first on Italian soil.
Garzelli completed the 150-kilometer (93-mile) distance, including two tough mountain passes, in three hours, 46 minutes, 45 seconds.
The 28-year-old Italian, who pocketed a 12-second time bonus from the stage victory, led Casagrande by 43 seconds overall. Simoni moved to third place, one minute behind the leader.
The decisive moves by the Giro favorites came on the final climb to Limone Piemonte, with Garzelli, Casagrande and Simoni making the pace.
Young Italian Franco Pellizzotti made a solo breakaway attempt four kilometers (2.5 miles) from the finish and piled up a 10-second lead, but was caught by pursuers 250 meters from the finish line.
Then Garzelli rushed into the lead and fought off the comeback attempt by Perez Fernandez and Simoni in the closing meters.
"My goal was to finish with the top riders and possibly achieve another stage win. I must say it was a positive day for me,'' Garzelli said.
Tyler Hamilton, the American captain of Team Tiscali, was delayed by a spill while pedaling in the leading group in the downhill section of Colletto del Moro.
It was the second fall in this Giro for Hamilton, who also hit the asphalt during the time test prologue in Groningen, Netherlands, last Saturday.
The American cyclist, who bruised his knee and his hip, ended the stage a few seconds behind the winner but still climbed from 21st to eighth place overall. He trailed Garzelli by 1:13 minutes.
Saturday's sixth stage is a 191-kilkometer (118.4-mile) hilly course from Cuneo to Varazze, along the Italian riviera.
May 17: Top 15 results of stage 5:
Fossano to Limone Piemonte (150 km):
1. Stefano Garzelli, Italy, Mapei, three hours, 46 minutes, 45 seconds.
2. Santiago Perez Fernandez, Spain, Kelme, same time.
3. Gilberto Simoni, Italy, Saeco, same time.
4. Francesco Casagrande, Italy, Fassa Bortolo, same time
5. Wladimir Belli, Italy, Fassa Bortolo, 7 seconds behind.
6. Fernando Escartin, Spain, Team Coast, same time.
7. Aitor Gonzalez Jimenez, Spain, Kelme, 9.
8. Ivan Gotti, Italy, Alessio, same time.
9. Tyler Hamilton, United States, Team Tiscali, same time.
10. Michele Scarponi, Italy, Acqua e Sapone, 14.
11. Pavel Tonkov, Russia, Lampre, same time.
12. Jens Heppner, Germany, Team Telekom, 17.
13. Georg Totschnig, Austria, Gerolsteiner, same time.
14. Paolo Savoldelli, Italy, Alexia, same time.
15. Faat Zakirov, Russia, Ceramiche Panaria, same time.
20, Cadel Evans, Australia, Mapei, 25.
21. Hernan Dario Munoz, Colombia, Selle Italia, 27.
28. Juan Carlos Dominguez, Spain, Phonak, 37.
44. Joaquim Castelblnaco, Colombia, Selle Italia, 3:04.
50. Rik Verbrugghe, Belgium, Lotto, same time.
65. Matthias Buxhofer, Austria, Phonak, 4:49.
76. Marco Pantani, Italy, Mercatone Uno, 7:02.
101. Mario Cipollini, Italy, Acqua e Sapone, 14:59.
165. Guido Trenti, United States, Acqua e Sapone, same time.
179. Robbie McEwen, Australia, Lotto, 15:23.
Did not start
Daniel Clavero, Spain; Danilo Hondo, Germany.
(After five stages)
1. Stefano Garzelli, Italy, 26 hours, 21 minutes, 28 seconds.
2. Francesco Casagrande, Italy, 43 seconds behind.
3. Gilberto Simoni, Italy, 1:00.
4. Santiago Perez Fernandez, Spain, 1:03.
5. Wladimir Belli, Italy, 1:06.
6. Juan Carlos Dominguez, Spain, 1:10.
7. Fernando Escartin, Spain, 1:11.
8. Tyler Hamilton, United States 1:13.
9. Cadel Evans, Australia, 1:14.
10. Davide Rebellin, Italy, 1:19.
11. Cristian Moreni, Italy, 1:27.
12. Dario Frigo, Italy, 1:29.
13. Aitor Gonzalez Jimenez, Spain, 1:32.
14. Jens Heppner, Germany, same time.
15. Michael Boogerd, Netherlands, 1:35.
21. Georg Totschnig, Austria, 1:57.
29. Rik Verbrugghe, Belgium, 3:35.
32. Hernan Dario Munoz, Colombia, 3:59.
36. Joaquim Castelblanco, Colombia, 4:47.
44. Matthias Buxhofer, Austria, 5:35.
56. Julio Perez Cuapio, Mexico, 7:17.
64. Marco Pantani, Italy, 8:58.
95. Mario Cipollini, Italy, 15:59.
113. Guido Trenti, United States, 18:55.
120. Robbie McEwen, Australia, 19:31.
174. Hidenori Nodera, Japan, 34:42.