Greipel withstood arch rival Cavendish’s challenge to win in three hours 31 minutes 21 seconds.
It was the first time Cavendish has been beaten by his former HTC teammate in a head-to-head sprint.
Thomas Voeckler retained his race leader’s yellow jersey.
Cavendish, who won stages five and seven last week to take his career tally to 17, was in a strong position in the finale, but Greipel (Omega Pharma-Lotto) won the race to the line, with Jose Joaquin Rojas (Movistar) third.
The duo were team-mates and outspoken rivals until this season, with Greipel leaving HTC-Highroad to claim his chance in the Tour.
Cavendish said: “I’m disappointed. I feel I made a mistake but Greipel beat me so there’s nothing I can say about that. I’m happy for him.”
The 26-year-old from the Isle of Man had to do much of the work himself and was without the support of key leadout men Bernhard Eisel, Matt Goss and Mark Renshaw, who were dropped in the closing stages.
He added: “I knew you couldn’t see the finish until the last 150 metres to go.
“It was a flat finish so I tried to go at 250m off (Liquigas’ Daniel) Oss’ wheel. I went early — it wasn’t too early on this type of finish.
“I didn’t hesitate but I didn’t commit early enough. I kind of rolled round Oss on the last corner and kicked with 170m to go and Greipel just came past and beat me.”
Cavendish is likely to have a further opportunity for his 18th Tour victory — and to reclaim the bragging rights from Greipel — in today’s 167.5km 11th stage from Blaye-les-Mines to Lavaur.
For four years, until Greipel signed with Omega Pharma-Lotto for the 2011 season, Cavendish and the German were team-mates.
However, the 2008 Giro d’Italia was the last time the duo rode in the same race after a series of squabbles on and off the bike. Even though the duo’s race schedules were separate, the bickering continued and Greipel opted to leave the team.
The German, who is riding in his first Tour, said: “Of course he wasn’t always friendly but this is not my style — I just try to show on the bike what I am able to do.”
Voeckler retained the maillot jaune and a lead of one minute 49 seconds from Luis-Leon Sanchez (Rabobank) as the position of the overall contenders remained unchanged.
Ireland’s Nicolas Roche finished 19th on the stage and lies 13th overall.