A second half goal from Lebogang Mothiba proved a consolation as Rodrigo Caio and Felipe Anderson scored within the first 20 minutes of the match, before Andreas Pereira sealed the win for the hosts.
The match kicked off at 23h30 (SA time) at the Rei Pele Stadium in Maceio on Sunday evening, with Owen Da Gama fielding a strong starting line-up.
Brazil opened the scoring through 22-year-old defender Caio, who headed home from a set-piece in the 15th minute.
Five minutes later, South Africa found themselves 2-0 down thanks to Lazio midfielder Anderson's 20th minute header.
Da Gama made an early sub as Kaizer Chiefs defender Lorenzo Gordinho was replaced by Tshepo Rikhotso in the 25th minute.
The substitute seemed to have helped the visitors keep Brazil at bay as they went into the half-time break 2-0 down.
Four substitutions at the break saw goalkeeper Jody February, Lebogang Phiri, Thapelo Morena and Kgosi Ntlhe replaced by Kyle Peters, Deolin Mekoa, Aubrey Modiba and Tebogo Moerane respectively.
Mothiba then pulled one back for South Africa just after the hour mark, however, any hopes of a come back were dashed when Pereira restored the two-goal cushion in the 73rd minute.
SA were dealt a blow late on when Witbank Spurs defender Thabo Macheke was forced off and rushed to hospital with a broken fibula.
SA u-23 XI: February (Peters 46'), Makhele (Macheke 90'), Gordinho (Rikhotso 25'), Mngonyama, Ntlhe (Moerane 46'), P. Ntshangase, Motupa, Dolly, Phiri (Mekoa 46'), Morena (Modiba 46'), Mothiba.
Brazil u-23 XI: Ederson, Wallace (Ely 46'), Fabinho, Doria, Caio (Rafinha 60'), Santos (Wendell 46'), Anderson, Sales, Luciano (Pereira 60'), Gabriel Jesus, Malcom.