US Postal rider Victor Hugo Pena, who was celebrating his 29th birthday, retained the yellow jersey but only has a one-second lead over reigning champion Lance Armstrong.
The day's racing in central France was lit up by an early breakaway which was brought to heel near the end of the stage.
Petacchi, the 29-year-old sprint sensation who won six stages of the Tour of Italy in June, was brought in to the final bend by his team before having to change tactics as the race entered the home straight.
As the fdjeux.com team of former race leader Brad McGee dominated the front group on the way in, Petacchi borrowed the wheels of two of his main rivals to get the jump he needed before coasting over the line ahead of Estonian Jaan Kirsipuu and Aussie Baden Cooke.
"I made my move from quite far back and started to go with about 200 meters to ride," explained Petacchi.
"It was quite risky for me because I'm not a sprinter like McEwen or (Oscar) Freire who can make the jump then change up a gear if they need to in the final 50 meters.
"It was difficult for my teammates because fdjeux.com were dominating the front on the way in to the final straight. My team did well to bring me as far as the final bend but then I had to take Zabel's wheel, then took McEwen's wheel for the final sprint."
Petacchi's burst of speed in the final 200 meters took everyone by surprise - and is a sign of greater things to come from the man who is already being compared to Italian great Mario Cipollini, the reigning world champion who has won 12 stages on the Tour de France but has never completed the race.
Cipollini's team Domina Vacanze were not invited to the Tour this year - and Petacchi, who said he wanted to finish the race in Paris, said he was already tiring of the comparisons to his flamboyant compatriot.
"I think I'm a different kind of sprinter to Mario," said Petacchi. "I would say if I had to be compared to anybody, it would be Zabel because I am quite good at finishing off sprints that are on a slight incline.
"But I'd prefer to say that I have my own style.
"I'd like to stop talking about Mario Cipollini because he's not here and I am," added Petacchi, who has now won three out of three sprints in which he has competed since Sunday's first stage proper.
The Italian began his campaign in style, winning Sunday's first stage ahead of McEwen and Zabel. A day later he did not compete the sprint after failing to respond to an attack by McGee a few kilometers from the line. A day later he bounced back to win the third stage ahead of Romans Vainsteins and Freire.
Now Petacchi, who had to be talked into riding the Tour after his tiring efforts in the Giro, said he wants to claim another stage and has plans for pulling on McEwen's green jersey.
"I came here with the aim of winning a stage," added Petacchi. "I feel more tired mentally than physically but I'm happy to have won the three sprints that I've been in, especially as it's a quality bunch out there.
"The green jersey is not really an aim for me but I admit it would be nice to wear it for a day. I wore the equivalent in the Giro for a spell so it would be nice to have worn both."
Although he said he intends to compete throughout the mountains stages, many people feel Petacchi is likely to abandon the Tour some time during or before.
He is already lining up an assault on the Tour of Spain in September in a bid to claim victories from the season's all three major stage races.
In the overall standings meanwhile there was little change as far as the top contenders are concerned.
Pena, who won the yellow jersey on Wednesday after US Postal's devastating victory in the 69km team time trial event, knows his team boss, Armstrong, is breathing down his neck.
A day after becoming the first rider from his country to don the yellow jersey, the Colombian said it had certainly been a special day.
"I suppose you could say it is the best birthday present I've had," said Pena smiling. "It's been a very special day."
US Postal riders still occupy the first eight places, while Spaniard Joseba Beloki (ONCE) is still ninth at 33sec with Jan Ullrich (Bianchi) 12th overall at 39.
McEwen meanwhile retained the green jersey for the points competition although the 31-year-old Australian could lose it on Friday's last stage on the flat before the race heads into the Alps for three days.
McEwen (108) has a one-point lead over Petacchi with Zabel, a six-time consecutive winner of the sprinter's prize, third on 98.
Cooke, the winner of Monday's stage is also in the hunt. The 24-year-old Australian is fourth on 88 points.
Stage 5 results, top 15 (Troyes - Nevers, 196.5 km)
1. Alessandro Petacchi, Italy, Fassa Bortolo, 4 hours, 9 minutes, 47 seconds.
2. Jaan Kirsipuu, Estonia, AG2R Prevoyance, same time.
3. Baden Cooke, Australia, fdjeux.com, same time.
4. Erik Zabel, Germany, Team Telekom, same time.
5. Robbie McEwen, Australia, Lotto-Domo, same time.
6. Luca Paolini, Italy, Quick Step-Davitamon, same time.
7. Thor Hushovd, Norway, Credit Agricole, same time.
8. Stuart O'Grady, Australia, Credit Agricole, same time.
9. Fred Rodriguez, United States, Caldirola-So.Di, same time.
10. Jean-Patrick Nazon, France, Jean Delatour, same time.
11. Olaf Pollack, Germany, Gerolsteiner, same time.
12. Oscar Freire, Spain, Rabobank, same time.
13. Damien Nazon, France, Brioches La Boulangere, same time.
14. Romans Vainsteins, Latvia, Caldirola-So.Di, same time.
15. Sebastien Hinault, France, Credit Agricole, same time.
39. Jan Ullrich, Germany, Bianchi, same time.
53. Lance Armstrong, United States, U.S. Postal Service, same time.
63. Victor Hugo Pena, Colombia, U.S. Postal Service, same time.
105. Tyler Hamilton, United States, Team CSC, same time.
52. George Hincapie, United States, U.S. Postal Service, same time.
114. Floyd Landis, United States, U.S. Postal Service, same time.
Stage 5 overall standings, top 15
1. Pena, 17 hours, 54 minutes, 31 seconds.
2. Armstrong, 1 second behind.
3. Viatcheslav Ekimov, Russia, U.S. Postal Service, 5 seconds behind.
4. Hincapie, 5 seconds behind.
5. Jose Luis Rubiera, Spain, U.S. Postal Service, 23 seconds behind.
6. Roberto Heras, Spain, U.S. Postal Service, 27 seconds behind.
7. Pavel Padrnos, Czech Republic, U.S Postal Service, 27 seconds behind.
8. Landis, 28 seconds behind.
9. Joseba Beloki, Spain, Once-Eroski, 33 seconds behind.
10. Jorg Jaksche, Germany, Once-Eroski, 38 seconds behind.
11. Manuel Beltran, Spain, U.S. Postal Service, 39 seconds behind.
12. Ullrich, 39 seconds behind.
13. Isidro Nozal, Spain, ONCE, 44 seconds behind.
14. Tobias Steinhauser, Germany, Bianchi, 51 seconds behind.
15. Mikel Pradera, Spain, ONCE, 58 seconds behind.