Gray is appealing a ruling that he has to testify in a sensitive lawsuit. (Bill O'Leary/The Washington Post)

Mayor Vincent C. Gray and two D.C. Council members will have to answer questions under oath about their roles in the approval of a controversial lottery deal, a federal judge ruled Monday.

The order came as part of a pretrial ruling in a lawsuit filed by Eric W. Payne, a former contracting director for the Office of the Chief Financial Officer who claims he was fired after raising questions about the handling of the lucrative lottery deal.

Payne is seeking depositions from Gray (D) as well as Council members Jack Evans (D-Ward 2) and Jim Graham (D-Ward 1). In court filings last month, Payne alleged that Graham and Evans improperly sought to derail the contract’s original 2008 bid to a joint venture involving allies of then Mayor Adrian M. Fenty (D).

U.S. District Magistrate Judge Deborah A. Robinson rejected arguments from the Council members that forcing their testimony would violate their privilege to keep legislative discussions private. She also rejected Gray’s claim that forcing him to testify would be “unduly burdensome” to the mayor.

“The conversations at issue here were plainly outside the realm of speech or debate” and thus protected by legislative privilege, Robinson wrote. Efforts by Gray, Evans and Graham to get contract information were “informal,” she added, and not directly related to the legislative process.

Regarding Gray, Robinson found that Payne met the standard for testimony from a top government executive — that he has personal knowledge of the issue at stake, and that no one else has similar knowledge.

“It is only Gray who can testify about his recollections of the conversations, and offer a non-hearsay account of what he said,” Robinson wrote.

Ted O. Gest, a spokesman for Attorney General Irvin B. Nathan, said the city would appeal on Gray’s behalf to U.S. District Judge Richard W. Roberts, who is presiding over the Payne case. (Robinson is handling only pre-trial motions.)

“We believe this attempt by Mr. Payne’s lawyer to depose the Mayor by compulsion is barred by several well established legal doctrines,” Gest said in an e-mail.