De Villiers finished third in the 326km fourth leg between San Juan and Chilecito with co-driver Dirk von Zitzewitz, in a time of 3:56:15, finishing six minutes and 42 seconds behind stage winners, and overall leaders, Stephane Peterhansel and Jean Paul Cottret.
While De Villiers improved his position on the leaderboard, he slipped behind, to five minutes and 41 seconds adrift of the front-runners.
Peterhansel, nine times a former winner of the Dakar (six times on a motorcycle and three in a car), remains the favourite to win ahead of De Villiers.
The South African pairing of Duncan Vos and Robert Howie also moved up a spot from 13th to 12th overall by finishing the fourth stage in eighth position, 13 minutes, 49 seconds behind Peterhansel.
De Vos is 57 minutes 50 seconds behind the leader overall.
Mark Corbett and Francois Jordaan (Century Racing CR4) ended the stage in 20th in a time of 4:25:14 and now lie 19th in the overall standings.
It was a brave recovery from the setback of two consecutive punctures on Tuesday’s stage three between San Rafael and San Juan after starting in 60th place, 35 min 14 sec behind the stage winners.
Off road and enduro motor cycle veteran Darryl Curtis leads the four-man South African contingent on two wheels on his KTM 450, impressing on his Dakar debut with 44th place overall after starting 144th four days ago.
Iain Stevenson is 111th, Greg Raaf is 115th and Neil Scott-Williams is 126th, all using KTMs.