Al-Attiyah had initially looked set to make further inroads into Peterhansel's advantage on the Arequipa to Arica stage as he set the early pace.
But what the Red Bull buggy driver described as a "navigational mistake" ultimately cost him six minutes.
Although that still kept Al-Attiyah in second place overall, Peterhansel's X-raid Mini now leads by 9m54s.
Peterhansel was second fastest on the stage behind team-mate Nani Roma, as the Spaniard stepped up his challenge after a quiet start.
Roma's stage win brings him to within eight seconds of fellow Mini man Leonid Novitskiy in what is now a battle for fourth.
Giniel de Villiers remains third despite a brake issue on stage five.
Robby Gordon was back on the pace after his disastrous start to the rally. The Hummer driver was third quickest, although this will be to little avail as he is over six hours behind the leaders overall.
Erstwhile leader Carlos Sainz is three hours from the frontrunners and still outside the top 20. He was fifth fastest on Wednesday for Red Bull.
Leading positions after stage four:
Pos Driver Team/Car Time/Gap
1. Stephane Peterhansel X-raid Mini 9h04m29s
2. Nasser Al-Attiyah Red Bull Buggy + 5m16s
3. Giniel de Villiers Imperial Toyota + 33m22s
4. Leonid Novitskiy X-raid Mini + 33m48s
5. Nani Roma X-raid Mini + 39m06s
6. Guerlain Chicherit SMG Buggy + 42m32s
7. Ronan Chabot SMG Buggy + 59m30s
8. Bernard Errandonea SMG Buggy + 1h04m54s
9. Boris Gadasin G-Force Nissan + 1h22m07s
10. Pascal Thomasse MD Buggy + 1h23m56s
Leading stage four times:
1. Nasser Al-Attiyah Red Bull Buggy 3h28m46s
2. Guerlain Chicherit SMG Buggy + 36s
3. Stephane Peterhansel X-raid Mini + 1m17s
4. Giniel de Villiers Imperial Toyota + 4m17s
5. Nani Roma X-raid Mini + 7m27s
6. Leonid Novitskiy X-raid Mini + 13m55s
7. Nunzio Coffaro Azimut Toyota + 20m45s
8. Ronan Chabot SMG Buggy + 21m07s
9. Pascal Thomasse MD Buggy + 24m37s
10. Bernard Errandonea SMG Buggy + 27m39s
- Sports & Recreation