Britain's Luol Deng will captain Team Africa against Team World in the NBA's first game in Africa.
The match will take place on 1 August at Ellis Park Arena in Johannesburg, South Africa.
Chris Paul of the Los Angeles Clippers will captain Team World.
"I am truly honoured to be part of this historic event," said Miami Heat's Deng, 30, who was born in South Sudan and represented Team GB at London 2012.
Team Africa will include players from Africa and second generation African players, while Team World will be represented by players from the rest of the world.
NBA Commissioner Adam Silver said: "The NBA has worked hard to grow the game of basketball in Africa, and I am excited to take this next step of playing our first game on the continent."
The game will support Boys & Girls Clubs of South Africa, S.O.S Children's Villages South Africa and the Nelson Mandela Foundation.