Naledi Pandor said she received a request to call Hamas leader Ismail Haniyeh to discuss humanitarian support.
"Minister Pandor and the Hamas leader discussed how to get the necessary humanitarian aid to Gaza and other parts of the Palestinian Territories," the Department of International Relations and Cooperation (DIRCO) said in a statement.
The ministry denied allegations in local media of government support for Hamas’ assault, which left more than 1,400 dead, mainly civilians, in Israel. Hamas fighters also took at least 199 people hostage.
Israel declared war on Hamas after the Islamist group's fighters broke through the heavily fortified Gaza border on Oct. 7.
Israel has hit Gaza with air strikes that have killed more than 2,700 people, imposed a crippling siege on the territory and demanded that residents in the north of the Gaza Strip move south ahead of a major urban ground assault.
DIRCO said reports South Africa’s government supported the Hamas attack were "untrue" and "meant to impugn the minister and the government of South Africa."
"During the call, and in line with the government's position, Minister Pandor reiterated... solidarity and support for the people of Palestine and expressed sadness and regret for the loss of innocent lives both Palestinians and Israelis."
"We do not have a bilateral relationship with Hamas. We have bilateral ties with the Palestinian Authority," presidential spokesman Vincent Magwenya wrote on X, formerly Twitter.
"Support for the Palestinian struggle against occupation does not equate to support for Hamas," he said.
Over the weekend, President Cyril Ramaphosa and several African National Congress (ANC) officials sporting Palestinian flags and keffiyeh scarves pledged their solidarity with the Palestinians.
"As people and an organization that has struggled against an oppressive system of apartheid, we do pledge solidarity with the Palestinians and as the African National Congress we have always pledged our solidarity with them," Ramaphosa said.
Several pro-Palestine and pro-Israel protests have taken place across the country.