Messi had been struck down by a bout of flu and only came on for the final 20 minutes; his appearance preceded by chants for him to be brought on, with a roof-lifting roar following when he got off the bench to warm up.
There is still uncertainty over the friendly match between Absa Premiership champions Mamelodi Sundowns and La Liga champions Barcelona billed to take place next week.
"It's not only special for me but to all South Africans, people in Africa, the whole world to see Barcelona playing against a South African team".
Dembele, Suarez and Gomes all took advantage of defensive errors, with Dembele curling a left-foot shot into net in the third minute and Suarez doubling the lead in the 18th minute.
Earlier, Percy Tau had missed a great opportunity to beat Ter Stegen in Barca goal while Denis Suarez headed against the post off Dembele cross.
Sibusiso Vilakazi scored Sundowns' goal late on but Barca was in cruise control.
Ivorian Soumahoro was also at fault for the second goal, failing to cut off a Denis Suarez pass on 19 minutes and Luis Suarez made no mistake from close range. It wasn't long before Valverde introduced sensational striker Lionel Messi into the attractive game much to the thrill of the crowd.
The teams played for the Mandela Centenary Cup, which forms part of the celebrations of the life of Nelson Mandela. The second half started pretty much the same as the first half with Barcelona's coach Ernesto Valverde changing most of his players. He said after the match that they have paid their school fees.