Honda rider Goncalves retired after a crash 155 kilometres into the stage, the Portuguese veteran injuring his right hand and head.
The stage, run from Moquegua to Arequipa, was an extremely close affair, with as many as eight riders separated by no more than a minute halfway through.
Pablo Quintanilla led at five of the first six waypoints but was only more than 20 seconds clear at the final one, where he and Husqvarna teammate Andrew Short had built a gap.
However, the order shuffled dramatically in the final stretch, and Quintanilla found himself only 11th as De Soultrait made up five minutes and took the lead instead.
De Soultrait’s second stage victory of the rally could yet be rescinded if Sunderland is given back enough time to overhaul a 7m29s deficit.
Matthias Walkner made a similar late-stage recovery to that of de Soultrait to take second, just nine seconds behind the Frenchman, with Lorenzo Santolino impressing on his Sherco TVS bike in third.
Adrien van Beveren brought a second Yamaha into the top four, narrowly beating Short and Luciano Benavides, the duo achieving identical times in fifth and sixth.
Several frontrunners had to settle for lower positions with Toby Price and Ricky Brabec taking eighth and 10th respectively, followed by Kevin Benavides and Quintanilla.
However, none of them lost a significant amount of time as they were all less than four minutes off the pace.
As a result, Brabec kept the overall lead, slightly extending it to 2m52s over Quintanilla, with Price a close third.
Walkner moved up to fourth, followed by van Beveren, Benavides and Sunderland, who could yet rise to as high as second when time adjustments are made.
UPDATE: Sunderland was given the stage win after his time was adjusted by 10m52s for helping Goncalves.
The Briton moves up to second in the overall standings.
Cavigliasso further extends lead
Nicolas Cavigliasso solidified his lead in the quad class by winning Stage 5 in dominant fashion, beating main rival Jeremias Gonzalez by 14m27s.
Cavigliasso gained most of his advantage between the last waypoint and the finish, extending his lead by nearly eight minutes there.
As a result, Gonzalez is now 49 and a half minutes behind Cavigliasso in the standings with Gustavo Gallego, who took third in the stage, further 20 minutes behind.
Standings after Stage 5 (Top 10, Bike class)
|6||Adrien Van Beveren||Yamaha||+6m36s|
|8||Xavier De Soultrait||Yamaha||+18m37s|