A Sterling, Va., man who pleaded guilty to conspiring to sell goods stolen from a federal warehouse in Ohio was sentenced yesterday to three years in prison by a judge in Alexandria.

U.S. District Judge Albert V. Bryan Jr. suspended all but six months of the prison term imposed on Toivo Emil Ekroos, 42, an Annandale car salesman, after a U.S. prosecutor said Ekroos had cooperated in testifying before a grand jury in the case.

A codefendant, Robert Harvey Strain, a former District police officer, has pleaded guilty to a single count of a seven-count indictment in connection with the alleged scheme and is scheduled to be sentenced next Friday.

Strain was accused of stealing cartons of cameras, video tape recorders and other items from a Dayton, Ohio, military exchange complex and giving them to Ekroos for sale to employes at Koons Ford, where Ekroos worked.

Ekroos yesterday asked Bryan for leniency, saying he already had spent five days after his arrest in the D.C. Jail. "That will make anybody go straight," Ekroos told the judge.

Ekroos appeared stunned by his sentence and faltered against the defense table in the courtroom before being led away by U.S. marshals.