Sunderland narrowly beat Jose Ignacio Cornejo by just 11 seconds after a strong end to the stage, having made up more than two minutes after the last checkpoint.
But the 2017 champion was found to have gone faster than allowed in a speed limit zone, which is a part of the route where competitors can't go faster than 30km/h.
Sunderland was handed a five-minute penalty, which dropped him to eighth in the order.
Cornejo inherited the top position as a result, the Chilean celebrating his maiden stage victory in his fourth year contesting the marathon.
Kevin Benavides completed a Honda 1-2 in the classification, while erstwhile stage winner Ross Branch (KTM) moved up to third.
In the overall order, Sunderland's penalty has cost him one position as he fell behind Husqvarna's Pablo Quintanilla to sixth place.
Cornejo's win is the second stage victory for Honda, which currently locks out the top three in the overall classification.
Franco Caimi, Yamaha's main rider following Xavier de Soultrait's retirement, was also given a five-minute penalty and dropped from fifth to 11th on the day.
Amended standings after Stage 4 (Bikes, top 10):
Jose Ignacio Cornejo