An Alexandria man's 1976 drug conviction was overturned yesterday after his wife testified she performed an oral sex act on the city's chief prosecutor in hopes of obtaining help for her husband.

Circuit Court Judge Raynor V. Snead upset the conviction after Sherry Freedman Chenault gave uncontradicted testimony about a sexual encounter she had with former commonwelath's attorney William L. Cowhig in his City Hall office.

"I kept telling him (Cowhig) I was doing it only for Danny," Chenault said, nodding toward her estranged husband, currently serving a five-year sentence for selling the drug PCP.

It was the first time Sherry Chenault, who was 19 at the time, has told her account in public of the enounter with Cowhig. The surfacing of her allegations preceded Cowhig's sudden decision to leave office earlier this year.

Snead, holding that lawyers in the drug case might have acted differently if they had known of the truth of Mrs. Chenault's testimony, ordered her husband released within 60 days. Under Virginia law, prosecutors are given that period in which to decide whether they wish to reindict a prisoner who has been granted freedom under a writ of habeas corpus.

Assistant Commonwealth Attorney Thomas Rawles Jones Jr. and Chenault's former lawyer Roger L. Amole testified that if they had believed Sherry Chenault, who had been indicted on drug charges with her husband, they might have asked for a special prosecutor to handle the case.

"The defendant is entitled to a fair and impartial hearing," Snead said. "If the facts had been known the case might have taken a different direction . . . (Danny Chenault) was adversely affected by the misconduct of Mr. Cowhig," he said.

Prosecutor Jones said he would seek the appointment of a special prosecutor to determine whether Chenault should be tried again on the drug charge. If Chenault is reindicted, he must remain in prison until the trial, Jones said after the hearing.

Cowhig, 54, who left office in February after being acquitted in two highly publicized trials on bingo-related charges, has consistently denied the allegations of sexual misconduct. Reached yesterday at his home in Daytona Beach, Fla., he declined to comments.

Cowhig is being investigated by a federal grand jury probing allegations of gambling, prostitution, and political corruption in Alexandria. He has said he is innocent of any wrongdoing.

Sherry Chenault testified yesterday that after their sexual episode, Cowhig drove her home in his car. During the ride, "I was crying . . . and frightened. He kept telling me not to worry, that Danny would get a light sentence," she testified.

However, no recommendation for leniency was ever made in Chenault's case.

Sherry Chenault subsequently pleaded guilty to a charge of possessing PCP and was placed on probation.

Her story of sex with Cowhig remained secret until February when Cowhig's deputy, John E. Kloch, learned of the allegations and requested appointment of a special prosecutor to investigate the charges.

The special prosecutor, the second to investigate Cowhig in less than a year, determined that no criminal activity took place during the Chenault-Cowhig meeting in the spring of 1975.

However, the matter was referred to the Virginia State Bar, which is running its own investigation of Cowhig's conduct in office.

Cowhig was elected Alexandria prosecutor in 1972 and reelected without opposition four years later.