Martin, one second behind Froome overall before the stage started, broke away from Froome's yellow jersey group some 3 kilometers (2 miles) from the end.
Froome and others let him go, knowing that Martin is not a Tour contender.
The 30-year-old Martin, a three-time world time trial champion who finished second behind Rohan Dennis in the opening stage's time trial, finally got the yellow jersey he craves and fell into the arms of his teammates once they had joined him over the line. Countryman John Degenkolb finished second and Slovak Peter Sagan was third.
With the time bonuses from his stage win, he leads Froome by 12 seconds and American rider Tejay Van Garderen by 25 seconds.
Defending Tour champion Vincenzo Nibali, who built last year's win on the back of a brilliant performance on the slippery cobbles, tried repeatedly to crack Froome's resistance over the seven paved sections.
But Froome, who crashed out of last year's Tour on the fifth stage after three falls in two days, held his nerve well.
He overcame one nervous moment when he almost lost control of his bike on the road, but having come through some stress-filled days of racing unscathed, his confidence is growing as he bids to win back the title he won in 2013. He leads Alberto Contador by 36 seconds; Nibali by 1:38 and Nairo Quintana by 1:56.
After Monday's dramatic spill, riders were hardly relishing taking on the cobbles dotted along the 223.5-kilometer (138.6-mile) trek from Seraing and to Cambrai, as the showcase race crossed the Meuse river in Belgium's Walloon region before swinging back into France.
The riders rolled over the first cobbles safely.
One down, six to go.
As the pack approached the next cobble section, the clouds started to thicken and darken, and the first of the dreaded rain drops began to fall. With the roads becoming more slippery, Dan Martin, Matteo Tosatto and Michele Scarponi fell taking a tight corner. They all got back in the saddle.
After losing time to Froome in stages 3 and 4, the Italian rider now had a chance to turn the tables on Froome, and his Astana teammates started to speed up at the front of the peloton heading into the second cobble section.
Fans packing the sides of the small and bumpy road shouted and cheered the riders on as the dust rose and the dirt caked rider's legs.
Nibali, Froome, Contador and Quintana all got over it safely, but others lagged behind and the main pack was split in two, while by now the front four riders had been caught.
Refusing to be intimidated by Nibali, Froome rode right next to him as they approached the third set of cobbles.
Flanked by teammate Lars Boom — a specialist on the cobbles — Nibali launched an attack. It took Froome by surprise, but he riposted quickly.
Section 4 made little impact, except for a small hiccup for Norwegian rider Alexander Kristoff, who had to change a punctured tire.
Approaching cobble section No. 5, Froome survived a scare when he went on the outside of Katusha rider Jacopo Guarnieri, who squeezed him for space. With his bike wobbling dangerously to the right, Froome steadied it just enough to prevent a fall.
Pushing hard from the front, Nibali was keeping the pressure on, but still had not gained any time on Froome after the fifth set of cobbles.
That left Nibali with two more cobble sections, to make a difference.
The sixth, 3.7 kilometers (2.3miles) from Fontaine-au-Tertre to Quievy, was the longest of the day.
The Tour contenders got through safely, but it cost French rider Thibaut Pinot valuable time after he sustained a puncture and waited for a tire change.
Nibali had one more chance on the final cobbled section — 2.3 kilometers (1.43 miles) — but Froome showed his strength again. Wednesday's mostly flat fifth stage, over 189.5 kilometers (117.5 miles) will be a welcome relief after a demanding few days.