Nine-time world rally champion Loeb clinched his fourth stage of this year's race, covering the 292 kilometre timed section from San Juan and Rio Cuarto in 3hr, 21min and 15sec.
Peterhansel kept the wheels firmly on his title bid by finishing second, just 18sec behind, to go into Saturday's final day with a 5min 32sec cushion.
As in the Tour de France, the Dakar's closing stage is normally a formality and barring disaster Peterhansel should add the 2017 title to his previous six wins on four wheels and his six on two, the first coming in 1991.
This year's motorbike title is destined to go for the first time to Briton Sam Sunderland.
The 27-year-old KTM rider, who has only ever made it as far as the fourth day on his previous two attempts, leads his rivals by over half an hour ahead of Saturday's closing stage into Buenos Aires.
"Victory is starting to creep into the mind a little bit and I'm trying to fight it away and stay focused on the job," he said.
"It's hard to explain the things that go through your mind when you're on the bike for twelve to fourteen hours a day on your own.
"You start to have all kinds of crazy thoughts. It's not easy to keep them quiet and focus on the job."
Paulo Goncalves claimed the 11th and penultimate stage with Sunderland in fifth.
The Portuguese, getting his name on the board for the first time this year, registered 3hrs 18min 47sec over the 288 kilometre timed section from Chilecito to Rio Cuarto.
His Spanish Honda teammate Joan Barreda Bort took second at 1min 9sec with France's Yamaha rider Adrien Van Beveren third at 2:38.
Sunderland leads his Austrian teammate Matthias Walkner in the overall standings by 33:09, with Van Beveren a further four minutes adrift in third.