Linwood (Big Boy) Gray, once alleged to be Washington's heroin kingpin and linked by authorities to five murders and the shooting of a federal prosecutor in 1978, was accused in federal court here today of threatening to hire someone to murder his attorney, noted defense lawyer Kenneth M. Robinson.

The muscular, 250-pound Gray, flown in by U.S. marshals last night from a federal prison in California, pleaded "not guilty" to conspiracy and extortion charges during a brief appearance before U.S. Magistrate Daniel E. Klein Jr.

Gray is accused, in a four-count indictment handed up Sept. 28 and sealed until today, of threatening to kill Robinson and Robinson's wife and two daughters after a dispute over a $60,000 home Gray owned in Prince George's County and deeded to Robinson as partial payment of legal fees for defending him in a heroin trial in 1979.

Gray, 39, was acquitted at the time of masterminding a $30 million heroin ring in Washington but was convicted of income tax evasion. He is serving his sentence on the tax charges at a federal prison in Lompoc, Calif.

Robinson, a flamboyant Washington attorney with a flair for courtroom theatrics who ran unsuccessfully for Congress last spring in the Republican primary in Prince George's County, could not be reached for comment today.

Also charged with Gray in the indictment unsealed today was Harry L. Staley, of Washington, described by law enforcement officials as a Gray confederate and an officer of the Capitol Hill Insurance Agency. He was reported still at large late today.

Staley is accused of participating with Gray in making threats against Robinson. The indictment also says Staley took title to Gray's Prince George's County home in July 1982 to conceal Gray's interest in the property. The property was one of several the Internal Revenue Service hoped to seize to satisfy unpaid taxes from Gray's 1979 conviction.

Gray is scheduled for parole consideration in December on the tax conviction, and federal prosecutors indicated today they are eager to have him held under newly enacted provisions of the federal pretrial detention act, in the event his trial here is delayed until after his parole date in California.

The indictment against him here follows an intense federal drug task force investigation headed by assistant U.S. attorneys David B. Irwin and Robert B. Green, who would not comment on the case.

The six-page indictment outlines the alleged scheme in which Gray, operating from his prison cell in Lompoc, is accused of threatening to kill Robinson and his family.

According to the indicitment and law enforcement officials, Gray owed Robinson substantial legal fees for the 1979 trial, and deeded his home at 6403 Pine Lane Dr. in Morningside to Robinson as partial payment in early 1980.

However, Gray's wife, Darlene B. Fleming, and their son continued living in the house, frequently failing to pay the rent, while Gray was in prison, according to the indictment and law enforcement officials.

Robinson complained to Gray in a series of telephone calls to Lompoc, and Gray threatened to kill Robinson if he evicted Fleming and the boy, according to the indictment and law enforcment sources. The threats by Gray to Robinson included a vow to arrange a "murder-for-hire" contract by Gray confederate Gary Randolph Frazier of Forestville, according to the indictment and federal sources.

Frazier was shot to death on Feb. 1, 1983, at a shopping center in Forestville, according to Prince George's County Police.

Gray continued his threats form prison, according to the indictment, until Robinson agreed to transfer the house back to Gray in mid-1982. Shortly afterward, Staley took title to the house, "thereby giving Gray actual control over said property and concealing Gray's interest" to avoid IRS seizure of the house, according to the indictment.

If convicted, Gray could be sentenced to a maximum of 48 years in prison and $25,000 in fines on the various counts of the indictment.

During the federal investigation of Gray leading to his heroin-tax trial in 1979, Barry L. Leibowitz, chief prosecutor against Gray, was shot and wounded in the federal courthouse parking lot in Washington on Dec. 20, 1978. At Gray's sentencing in 1979, prosecutors alleged Gray was responsible for the shooting of Leibowitz and the slayings of five persons associated with Gray's alleged heroin ring. Gray denied the claims and was never tried for the Leibowitz shooting.