The Clever Boys broke the deadlock in the 10th minute when Vincent Pule's cross was turned home by Gamal for his third goal of the tournament.
Gavin Hunt's charges dominated most of the possession in the first half, but they struggled to carve out more clear-cut chances.
Baroka, meanwhile, were finding it tough to fashion chances in the opening stanza as they spent most of the half chasing the ball.
Wits nearly found a second goal in the 42nd minute, but Baroka goalkeeper Virgil Vries pulled off a good save to keep out Pule's headed effort.
After a quiet start to the second half, Wits were dealt a blow in the 62nd minute when Nazeer Allie was forced off with an injury. He was replaced by Granwald Scott.
Talent Chawapiwa looked to bring the visitors level in the 73rd minute, but his effort from distance was kept out by Darren Keet.
Baroka threw on Richard Matloga for Sipho Moeti with three minutes remaining as they pushed for a equaliser.
However, Wits managed to see out the closing stages of the second half to secure the win and their spot in the last-four.