The Washington Diplomats have been sold to Madison Square Garden Corp. and a letter of agreement has been signed that will keep the North American Soccer League team here for at least five years.

Steve Danzansky will remain as president of the team under the new management, which is a subsidiary of the Gulf and Western conglomerate.

Danzansky and his father Joseph, a local businessman, will be substantial minority investers in the club, Steve Danzansky said. The senior Danzansky is a member of the board of directors of San Juan Racing, which lost a reported $2 million before selling the team.

Sources close to Gulf and Western said the purchase price was in the vicinity of $15 million.

A press conference has been called for 12:30 p.m. today to announce the sale.

The clause that will keep the team here for at least five years is included in a letter of agreement signed by the Dips, Madison Square Garden Corp. and the D.C. Armory Board covering options to extend the Dips' lease at RFK Stadium for 15 years.

Three sources said yesterday that Gulf and Western also had shown an interest in the possibility of purchasing a major league baseball team and bringing it to RFK Stadium, also.

That possibility was discussed during sales negotiations between the Dips and MSG Corp. it was learned.

For Gulf and Western, such a purchase - the Baltimore Orioles are for sale with a reported price tag of $12 million - would be pocket change. Gulf and Western's eight groups of companies produced sales of approximately $4 billion last year.

MSG Corp. under Sonny Werblin who made a success of the American Football League and the New Jersey Meadowlands, is part of Gulf and Western's leisure-time group, which had sales of $470 million last year. MSG Corp. also owns Madison Square Garden, the New York Knicks basketball team and the New York Rangers hockey club.

Gulf and Western subsidiaries include such companies as Paramount Picture, Simon and Schuster publishers, Schraft's candies, and companies that manufacture such items as Supphose, Bostonian shoes, Fruit of the Loom underwear, Dutch Masters cigars and Excello shirts.

Gulf and Western also has an interest in the growing and milling of sugar cane and in financial services.

When the negotiations for the Dips began, Werblin's plan was to buy the team and move it to New York's Shea Stadium to compete against the NASL champion Cosmos. However, a large indemnification price and league wishes to have a team here were major factors in the deal that was completed Tuesday night.

Danzansky, attending NASL meetings yesterday in Chicago, refused to discuss specifics of his family's involvement with the team, the purchase price and the teams of the new lease for RFK Stadium.

But he said, "If you want to speculate on the length of the Garden commitment to stay in Washington, I think you can look at the fact the Danzanskys will still be involved with the club as stockholders and as part of management.

"If the Garden wasn't planning to stay here for awhile, why would they want the Danzanskys to remain involved with the club?"

Jack Krumpe, a Garden vice president and Werblin's right-hand man, said the Garden has yet to evaluate the assets of its newest acquisition because time recently has been spent in completing the deal in time for approval at the current NASL meetings.

Werblin's past history suggests an aggressive marketing campaign. He has believed in spending money to make money.

"I can't tell you how much money we'll have to spend because we haven't sat down and analyzed our assets," Krumpe said. "It's going to be the purchase of a team and we'll make it go, the details of which we have to get into because we haven't sat down and discussed it yet ourselves."