Two first-half goals from Ousmane Dembele and Luis Suarez put the visitors in the driving seat at half-time.
Finally, the capacity crowd had their wish when Lionel Messi, reportedly not fully fit, entered the fray in the 74th minute, with Philippe Coutinho also being introduced into the action.
His every touch drew huge applause and Sundowns defender Wayne Arendse was beaming after the final whistle having exchanged shirts with the Argentine maestro.
This is the second time Barcelona are playing in South Africa.
The match was played at Loftus Versfeld - three years later the scene of Bafana Bafana's 3-0 loss to Uruguay that scuppered their 2010 FIFA World Cup second round hopes - and it was a surprisingly open and intense fixture for what was a game played early in the pre-season for both sides.
With World Cup looming, Neymar admits he's scared
I think it's one of the most hard I've ever had, because I'm very close to a dream I have, which is the World Cup . "It is my goal.
"We came to play football and to honour Nelson Mandela, someone who was very close to the hearts of all Spaniards".
Mamelodi Sundowns coach Pitso Mosimane said: "If you look at the match and if you look at the result, you look at the goals you understand that this team [Barca] scores goals, they scored four goals yesterday".
"I am so happy with my boys because they always tried to play football the way I want them to - building from the back". I would like to thank the president [Patrice Motsepe] for making it happen.
Barcelona conclude their domestic campaign against Real Sociedad at the Nou Camp on Sunday.
The hosts had a great chance to level matters 10 minutes later when Percy Tau sprinted clear through on goal, but he tried to get too clever with an attempted chip and Barcelona keeper Andre ter Stegen made a comfortable save. One of the substitutes, Andre Gomes, added Barca's third after good work by Paco Alcacer.