I'm a bit confused here:
- You are carrying 5 laptops from the US in your luggage.
- You are transiting through Dubai on your way to South Africa.
In Dubai - you will not go through customs (unless you have an extended layover). So no fear of customs actions here; while you are in transit there is a security check upon arrival into the transit area but that's it.
On your arrival in South Africa, however the 5 laptops might cause a problem. Normally there are no restrictions but:
In addition to personal effects and the above consumable allowances,
travellers are allowed new or used goods in accompanied baggage to the
value of R5 000.
I believe you will run afoul of this rule and will have to pay the normal duty/taxes on the laptops.
You can find more details at the SARS website for travelers.
SARS = South African Revenue Service.
I have to say anyone bringing in 5 new laptops will raise eyebrows even in those countries where they are no import duties on such goods.