Emergency workers said the fire broke out in the abandoned building which had no running water and electricity early in the morning.
"Six people died from smoke inhalation and one person died after he jumped out of the building try to escape," said Johannesburg Emergency Management Services spokeswoman Nana Radebe.
She said 50 people were rescued from the blaze, seven of them requiring hospitalisation for burns and smoke inhalation treatment.
The cause of the fire was not immediately clear, but an eyewitness told local media that the inferno was sparked by a generator used by one tenant for lighting.
According to city officials, over 300,000 people around the Johannesburg metro area were on the waiting list for government subsidised homes.