Zambia charged yesterday that South Africa is massing troops and aircraft on its southern border in preparation for an "imminent aggression" against Zambia territory.

In an rare diplomatic action to underscore the Zambian concern. Foreign Minister Siteke Mwale Tuesday night called in the heads of mission from the five Western powers involved in the Namibia negotiations to inform them of an alleged South African military buildup in the Caprivi Strip of northeastern Namibia.

Mwale warned the Western diplomats that Zambia reserved the right to seek help from "any friendly country" should South Africa attack. This was taken here to be primarily a reference ot the Soviet Union and Cuba, although Zambia has recently asked the United States for military assistance.

He said that the movement of South African troops near the Zambian border town of Sesheke "gives every sign of the preparation of an attack and has become a threat of another imminent aggression against Zambia, the government newspaper, the Daily Mail, reported yesterday.

Western diplomatic sources here could not immediately corroborate the Zambian allegation of a South African buildup along the border but expressed concern at the possibility that Pretoria might be planning another raid against Namibian nationalist camps like the one deep inside Angola May 4.

The Southwest Africa Peoples Organization, the black nationalist movement fighting to end South African rule in Namibia, has its headquarters here in Lusaka.

Zambia has charged South Africa with border violations and attacks on Zambian towns several times in the past.

The South African government issued a statement later yesterday denying it had any aggressive intent against its neighbors but also indicating it intended to protect Namibia, which is still under South Africa's administrations, from attacks across the border by Namibian nationalist guerrillas.

Western sources here said that any renewed South African military activity along either the Angolan or Zambian borders could have an adverse effect on negotiations about to be resumed between the Namibian nationalists and the five Western powers over the latter's peace plan for the South African-administered territory.

They noted that the South African raid in early May on a Namibian refugee and guerrilla camp at Kassinga, 155 miles inside Angola, had served to provoke the nationalists into breaking off talks then under way with the five in New York. Angola has said more than 600 refugees and guerrillas were killed and 420 wounded in that attack.

A spokesman for SWAPO said the organization has received information through its own sources about a South African buildup in the Caprivi Strip. Another official said any attack on Zambia would threaten chances for a renewal of talks.

The presumed purpose of any South African attack on Zambia would be to strike at SWAPO camps located in southern region of the country along the Caprivi Strip.

Whether an attack is indeed being prepared, the Zambian charges against South Africa serve to highlight the growing tensions in southern Africa, both as a result of the steadily worsening fighting inside Rhodesia and Namibia and as a consequence of South Africa's raid into Angola as well as the latest rebel invasion of Zaire's southern Shaba Province.

In a major policy speech to his nation Monday, Zambian President Kenneth Kaunda warned that "Africa is on fire" and becoming a veritable "battlefield for various international forces."

"The weapons of East and West are starting to play a key role" in determining international security in central and southern Africa, he said. Noting Zambia's own mounting security problems, he said that "in the event of an attack by a South Africa-backed force, we as a sovereign state reserve the right to call upon any friendly nation to assist us in the defense of our country."

Previous to his mid-May state visit to the United States, Kaunda had told several Western correspondents that he was considering turning to the Soviet Union and Cuba for military assistance. While in Washington, however, he was reported here to have asked the Carter administration for military aid of an unspecified nature to strengthen Zambia's modest defenses.

There has been no reply to the Zambian request so far from the White House as far as is known here.