In the longest special of the rally so far — 506 kilometers from Neuquen to San Rafael in Chile — de Villiers mastered the sand dunes to reach the finish line in 5 hours, 47 minutes.
Sprint Cup driver Robby Gordon finished third and moved to seventh overall, 41 minutes, 48 seconds behind Qatari driver Nasser Al-Attiyah.
Spaniard Carlos Sainz, who led the rally entering Stage 5, lost more than 15 minutes after steering problems hampered his driving. He dropped to third place overall.
Al-Attiyah, who won Stages 1 and 3, now leads de Villiers by 2 minutes, 24 seconds in the overall standings.
Yvan Muller, competing in a single-seater SMG buggy, was forced out of the event after his car caught fire following a collision with the truck of Elisabete Jacinto. No one was injured.
After 14 stages covering the 9,574-kilometer (5,950-mile) circuit, the race will finish on Jan. 18 in Buenos Aires.
Thursday's route is a 395-kilometer drive from San Rafael to Mendoza.
The Dakar Rally is being broadcast on Versus, with daily updates on RobbyGordon.com.