South Africa has one of the highest murder rates in the world, with around 60 people killed per day on average.
Shootings in informal settlements are highly common in the country and are sometimes linked to gang violence and personal disputes.
The local police department said its officers responded to a “complaint of shooting in progress” at about 23:10 local time on Tuesday (21:10 GMT).
Emergency medical services were also deployed to treat the injured.
Police said eight men and three women died at the scene, while an additional man died from his injuries in hospital.
At least nine others were taken to various medical facilities for treatment of gunshot wounds.
The police statement said that “the motive for the attack is currently unknown and forms part of the ongoing investigation”.
Last year, nine people were killed in a mass shooting at a tavern in Johannesburg.
There are about three million legally held firearms in South Africa and at least the same number of unlicensed weapons, according to statistics cited by Gideon Joubert from the South African Gunowners’ Association.