The brutal attack took place in 2006.
Lubabalo Ntlabathi, Sicelo Mase, Luyanda Londzi and Mbulelo Damba were sentenced by the Khayelitsha Regional Court to 18 years, four of which were suspended for five years.
A crowd outside the court cheered, sang, raised their fists and danced when news came that the men had been sentenced.
“We asked the presiding officer to sentence the men to no less than 15 years in prison as they committed a heinous crime, killed a young woman because she was living openly as a lesbian, never showed any remorse or accepted responsibility for what they have done,” National Prosecuting Authority spokesman Eric Ntabazalila said.
“Only their parents apologised on their behalf and we believe rehabilitation stands a small chance of being achieved.”
The men were found to have killed Nkonyana because she was openly living as a lesbian.
Another five accused were acquitted.
The National Prosecuting Authority's Ntabazalila said the sentence sent a strong message that hate crimes would not be tolerated.
“We are happy that the court agreed with us that these gentlemen did not show any remorse and had a slim chance of being rehabilitated,” he said.
Nkonyana’s stepfather, Gladwell Mandini, 45, said: “They did not accept responsibility for what they did and we are happy that when we asked for a lengthy jail term, she (the magistrate) agreed to that.”
He said the long court case that saw numerous postponements had been an ordeal for the family.
“It wasn’t easy all these times the case was postponed. As the family we have accepted this, but the loss we will not forget.”
Jayne Arnoff, a director of the gay and lesbian organisation Triangle Project, said they were satisfied with the sentencing.
“The magistrate said Zoliswa had a right to live openly as a lesbian because that was her own choice,” she said.
“She sent out a strong message that we are a diverse society and that we must respect each other’s diversity.”