Union longshoremen and shippers operating on the East and Gulf coasts yesterday reached an interim contract accord that appears to end an immediate threat of a dock strike when the existing contract expires Sept. 30.

The International Longshoremen's Association, AFL-CIO and seven major harbor management groups meeting in Bal Harbour, Fla., tentatively agreed to a three-and-a-half month pact that they said was designed to maintain labor peace while negotiations on local contract terms and court proceedings involving a major contract issue continue. The new deadline is Jan. 15, 1984.

The two sides had reached an earlier tentative three-year agreement last April that was thrown into question earlier this month when the Federal Maritime Commission went to court seeking to block a portion of the agreement.

The FMC has asked a federal judge in New York to enjoin shippers from implementing a work rule that gives the ILA the exclusive right to pack shipping containers within 50 miles of East and Gulf coast ports. The rule is part of the previously negotiated agreement on a national master contract.

Last week, the union's executive council asked workers to reject that tentative settlement since that key feature had been thrown into doubt by both the FMC action and an appeal of a National Labor Relations Board decision upholding the rule. That tentative agreement has now been revoked and balloting on it cancelled, according to the ILA.