Saiful, 25, who was an aide in Anwar's office, has accused Anwar of sodomising him in 2008. If convicted, Anwar, 62, could face up to 20 years in prison.
Sodomy, even among consenting adults, is illegal under Malaysian law.
Anwar's lawyers filed the application after Farah Azlina Latif, a junior prosecutor, was dropped from the case last month.
The move came after a leading political blog reported she was romantically involved with Saiful.
Anwar, who was sacked and jailed on separate sex and corruption counts a decade ago, said the revelation of the alleged affair was more proof that he is the victim of a conspiracy to end his political career.
"It just supports our contention right from the beginning that this is all a farce, a politically motivated trial, trumped-up charges," he told reporters.
Karpal Singh, Anwar's defence lawyer, told the court that Saiful could have been given access to confidential trial information, and that both he and Farah would have to state whether the claim was true.
"Because of this affair, the integrity of the entire prosecution of this trial has been compromised," Singh said.
|Saiful accused Anwar of having illicit sexual relations with him in 2008 [AFP]
"As a result of this affair there is a strong likelihood of Saiful being privy to statements recorded in the course of investigations including a statement from Anwar Ibrahim."
The defence has made a series of legal manoeuvres designed to undermine the credibility of the trial, but has so far been knocked back in all its moves including bids to gain access to evidence such as medical reports.
Anwar has said he is the victim of a plot to prevent him from taking power, after the opposition made huge strides in the 2008 general elections, stunning the ruling Barisan Nasional coalition which has been in power for half a century.
The trial, which began in February and has been punctuated by lengthy delays, is scheduled to resume on Monday for a one-month session.