The Navy announced yesterday that the captain, executive officer and tactical action officer of the USS Stark have been relieved because of dissatisfaction with their performance on May 17 when the ship failed to react to an Iraqi fighter-bomber that fired two missiles into the ship, killing 37 sailors.

The Navy said Adm. Carlisle A.H. Trost, chief of naval operations, relieved the officers after the theater commander, Marine Gen. George B. Crist, "requested that these officers be detached based on his lack of confidence in their performance."

Pentagon sources said a Navy investigating panel, headed by Rear Adm. Grant Sharp, has recommended courts-martial for the three officers, but the Navy did not confirm this. The relief of the officers at this stage, however, suggests courts-martials have been recommended. Defense Secretary Caspar W. Weinberger will have the final say on whether to conduct the courts-martial.

The officers relieved yesterday are Capt. Glenn R. Brindel, 43, of Pittsburgh, the skipper since Jan. 23, 1985; Lt. Cmdr. Raymond Gajan Jr., 35, of Rockville, executive officer, and Lt. Basil E. Moncrief, 32, of Corpus Christi, Tex., tactical action officer. The executive officer is the captain's right-hand man, while the tactical action officer runs the combat center of the ship where weapons are ordered into action.

Brindel has been ordered to the Atlantic Fleet's surface force in Norfolk, while Gajan and Moncrief have been sent to the command staff of Destroyer Group 12 in Mayport, Fla.

The Sharp panel also investigated the performance of the Stark's weapons officer, whom the Navy has not identified, but no action has been announced as to him. Navy officials said this suggests he had the weapons in condition to fire.

In a statement to House Armed Services Committee investigators, Brindel seemed to fault Moncrief for not keeping him informed about the approaching Mirage F1 fighter-bomber.

Brindel said he had told Moncrief "to keep a close eye on the contact." Brindel recommended that Navy investigators determine why he was not kept informed.

The committee report said a first class petty officer had asked Moncrief if he should radio a warning to the Iraqi aircraft when it was 43 miles from the ship. "The TAO instructed him to wait," the committee said.

"The TAO said he expected the Mirage would be turning at any moment, according to the watch supervisor." The TAO waited until the plane was only 15 miles away before he ordered a warning be radioed to it, according to the committee report.

The heavy damage done to the Stark as it was steaming on patrol at night in the gulf has generated warnings in Congress that the Reagan administration is asking for trouble if it goes ahead with its plan to escort 11 Kuwaiti tankers flying the U.S. flag through the waterway.

While portraying the risks of the escort operation as modest, the Pentagon said yesterday it has sent about 20 Navy experts from Charleston, S.C., to the gulf to assess the danger from Iranian mines that the administration has said Iran is sowing in Kuwaiti ports.

Floating mines have hit ships in the gulf, but a Pentagon official yesterday said this danger "is manageable."

Another source of concern is the Silkworm missile, which Iran has received from China. The weapon with a range of 50 miles and a warhead of 1,100 pounds has been tested in the gulf at the Strait of Hormuz, which is 40 miles wide at its narrowest point. The Reagan administration has been debating with how to combat the Iranian Silkworm if it becomes operational at the edge of the strait.

Adm. William J. Crowe Jr., chairman of the Joint Chiefs of Staff, opposes a preemptive strike against the missile, according to Pentagon officials.

The Pentagon in its public version of a report on how it plans to handle threats to shipping in the Persian Gulf cited the Iranian Silkworm several times. The secret version of the report said Iraq also has the Silkworm, defense sources said.

A Pentagon spokesman said last night that the Iraqi Silkworm was not considered relevant to the public version of the report because it is not targeted on the waterway. Iraq is believed to have received the Silkworm from China.