Five reporters must testify about their law enforcement sources in a former Army scientist’s lawsuit against the Justice Department, a federal judge in Washington ruled yesterday.

The suit, filed by Steven J. Hatfill, a bioterrorism expert, contends that the government violated the federal Privacy Act by providing journalists with information about him in the F.B.I.’s investigation of the deadly anthrax mailings in 2001.

The reporters  Michael Isikoff and Daniel Klaidman of Newsweek; Allan Lengel of The Washington Post; Toni Locy, formerly of USA Today; and James Stewart, formerly of CBS News  have acknowledged receiving information from the Justice Department and the F.B.I. about Dr. Hatfill, the judge, Reggie B. Walton, wrote in his decision yesterday. But they have refused to name their sources.

Judge Walton, of the Federal District Court in Washington, said Dr. Hatfill was entitled to the sources’ names because “the information sought is clearly central to his Privacy Act claims.”