Cavendish claimed his 21st career Tour stage win, giving him sole possession of sixth place on the all-time list. Next up for the Briton is Lance Armstrong's mark of 22 stage wins.
Cavendish had been left to fend for himself after his Team Sky teammates decided to put their main efforts into helping Bradley Wiggins gain the yellow jersey in the general classification.
Riding solo during the final kilometer of the 129-mile stage from Vise to Tournai in Belgium, Cavendish passed the Greipel down the stretch in a final burst of speed for the stage win.
Australia's Matt Goss finished third.
Wiggins remained 7 seconds behind Fabian Cancellara of Switzerland in the overall standings after Stage 2.
Caroline Berg Eriksen: Soccer player's wife triggers debate with post-birth selfie
18-year-old elf alleges mall Santa pinched her buttocks on the job