The song United We Stand brings together Ladysmith Black Mambazo from South Africa and Malian singer Salif Keita.
Lyrics include the line "Africa is our home, make it a better place".
At least seven people have died over a month of attacks on foreigners and foreign-owned property in South Africa.
African news at it happens: 1 May 2015
Ladysmith Black Mambazo singer Sibongiseni Shabalala told the BBC he was trying to send the message that "Africa is for all of us".
"You can't say you don't like the foreigners to stay in your country. This is not your country, this is our country.
"We are saying people should unite. If there's problems, people should sit down and talk.
"One day your child will want to go and live in Mali, Nigeria or Ghana but because of your decision today it will be very difficult for your future generation to be able to do the same."
The song is playing on South African radio from Friday, will be premiered on TV on Friday evening and will be released on iTunes on Monday.

BBC Wales understands an advisory panel on creative industries recommends rejecting a request from University of Wales Trinity St David for up to £6m.
The panel is concerned a similar hub already exists in Swansea.
Camarthenshire council leader Emlyn Dole said the comparison was "completely inappropriate".
The panel is chaired by Ron Jones, executive chairman of Tinopolis.
It did not take into account whether the scheme - Yr Egin - would provide any educational or linguistic benefits.
Economy Secretary Ken Skates told the assembly in November it was "disappointing" that a "funding gap" had appeared since the university first announced the plans in 2014.
Mr Skates has yet to decide on the university's application for between £4m and £6m of public funding.
Directors of the project have previously estimated the new centre for creative industries would be worth £11m a year to the local economy.
Planning permission for the development was granted in October and Kier Group has been appointed as the main contractor.
S4C has previously said its plans to relocate remain unaffected, with 55 jobs moving from Cardiff.  It has agreed to pay £3m in upfront rent for a 20 year lease.
The Welsh Government, the university and S4C have refused to comment.
Carmarthenshire council leader Emlyn Dole said he was extremely disappointed and concerned by the news.
"The comparison between the development in Swansea and Yr Egin is completely inappropriate," he said.
"Yr Egin involves the construction of a pioneering creative and digital hub and the development of a creative sector cluster, not just for the Swansea Bay region but for the whole of Wales."
Plaid Cymru economy spokesman Adam Price claimed "continued speculation" over the future of Yr Egin could put the wider £1.3bn "city deal" investment plan for the Swansea Bay region at risk.
"This project poses no financial risk whatsoever to the Welsh Government," he said of Yr Egin.
"The university has presented a series of funding proposals which would see the taxpayer fully reimbursed if the project doesn't meet the performance criteria agreed.
"So, with the university acting as a guarantor for the investment, we have to ask the Welsh Government: what's stopping you?"

Marquinhos, who has signed a five-year deal, joined Roma from Corinthians a year ago for £3.9m, although the Brazilians will now earn another £2.3m.
PSG president Nasser Al-Khelaifi said: "It underlines the club's desire to look towards the future to construct one of Europe's biggest clubs."
Earlier this month, PSG paid Napoli £55m for Uruuay striker Edinson Cavani.
Marquinhos, whose full name is Marcos Aoas Correa, made a huge impact in his debut season in Serie A and was linked with moves to Manchester United and Barcelona.
"I am delighted to be joining Paris St-Germain, a club where so many Brazilians have played and helped write the club's history," he said.
Two of Africa's most famous musicians have released a song against the recent violence against foreigners in South Africa.
[NEXT_CONCEPT]
A creative industries development in Carmarthen which includes the new headquarters of S4C should not receive public money, ministers have been told.
[NEXT_CONCEPT]
French champions Paris St-Germain have signed 19-year-old Brazilian defender Marquinhos from Roma for £27m.