Ayatollah Ruhollah Khomeini intervened in the lingering dispute over Iran's Cabinet late yesterday and told President Abol Hassan Bani-Sadr that he need only approve those ministers he found acceptable, the state radio reported.

The ayatollah's decision appeared to break the deadlock over Prime Minister Mohammed Ali Rajai's Cabinet, which the president has refused to approve for the last week.

Meanwhile, outgoing Foreign Minister Sadegh Ghotbzadeh had denounced Rajai as "not competent for the job" and said resolving the problem of the American hostages was of paramount importance to the survival of the country's Islamic revolution.

In an interview with UPI Television News of London, conducted Thursday and released yesterday, Ghotbzadeh said he thought Iran's new hard-line government did not have much chance of surviving.

In Tehran, Bani-Sadr brought Khomeini a list of acceptable ministers for the government at a meeting this afternoon, the state radio added.

"The iman [Khomeini] said those who had been approved here were to be introduced and those few remaining to be introduced gradually," the president was quoted as saying after the meeting.

Rajai's reaction to the decision was not immediately known, but political observers thought it highly improbable that he would challenge Khomeini's verdict.

A spokesman for the presidential office said he expected Bani-Sadr to name those ministers he approved "within days." They then will be introduced to the parliament, which next sits in open session on Sunday.

The speaker of the parliament said two days go that the president was withholding his approval, necessary under the constitution, for four of the prime minister's 20 nominees.

Khomeini's intervention came as a surprise since earlier this week he told the president bluntly, "I do not interfere in these affairs."

The threat of a drawn-out political crisis, however, appears to have made the ayatollah change his mind.

In his interview, Ghotbzadeh addressed what he saw as the new prime minister's weakness. "The changes of new government, I think, are slim, especially with the formation as I have seen it," he said. "As far as Mr. Raji is concerned, he is a Moselem, a devoted Moslem, but I don't believe he is competent for the job. His record in the Ministry of Education has shown that it's not promising for the future," Ghotbzadeh said.

Ghotbzadeh also said it is important for Iran to solve the problem of the 52 American hostages who have been held since Nov. 4, but he stopped short of calling for their immediate release.

"What is exteremly important is to end the confrontation with the United States . . . in order to have Europeans and Third World countries on our side," he said.

"As long as we have this problem of the hostages, they are not on our side," Ghotbzadeh said. "They are not even indifferent or neutral . . . We've got to resolve this problem."

In another development, the Iranian parliament, which Khomeini has charged with determining the fate of the American hostages, was reportedly on the verge of suggesting a U.S. congressional inquiry to "pave the way" for a solution.

The Tehran newspaper Kayhan reported that the suggestion is contained in a draft of a reply from the parliament to a recent appeal for the release of the hostages by 187 members of Congress.

The newspaper said parliament's "draft letter" suggests that the U.S. Congress "do something positive" toward ending the hostage crisis. The draft reportedly did not call for the return of the late shah's wealth. This and American admission of guilt for alleged interference in Iran's affairs have been Iran's two main conditions for release of the hostages.

The U.S. administration has made it clear that the shah's assets are a matter for the courts.

Meanwhile, the official Pars News Agency said a recent letter from Secretary of State Edmund Muskie urging release of the hostages contained an implicit admission of past U.S. interference in Iran.

Muskie's letter to Rajai has not been published yet, but its general contents were reported by ABC News and confirmed by State Department officials.

In a commentary, Pars quoted the letter as saying that if the 52 hostages are released, the United States would not intervene in Iran's internal affairs.

"This statement is, in fact, an admission of U.S. interference in the domestic affairs of Iran, which is now an open secret all over the world," the agency said.