The match will take place at ANZ Stadium in Sydney on Monday 26 May.
The Socceroos squad will fly out to Brazil two days later.
Football Federation Australia will confirm the match against Bafana Bafana at an announcement at the Olympic venue on Monday.
The South Africans, who face Brazil in an international match in Johannesburg on Thursday (AEDT), failed to qualify for this year's World Cup.
The Sydney game will be the last for coach Ange Postecoglou's team before it travels to Brazil for the World Cup.
The Socceroos face tough opposition in Group B featuring Chile, Netherlands and world champion Spain.
The Socceroos this week will play Ecuador in London in the last international before Postecoglou announces his preliminary 30-member squad for the World Cup.