Sonko's trial opened on May 16 but was immediately adjourned until May 23 after he failed to attend.
On Friday he demanded guarantees for his safety as a condition for attending the trial.
"If all the (security) conditions are met, I will be there," he said.
Highly popular among young people, Sonko has branded the trial a political plot aimed at scuttling his bid for the 2024 presidency.
He has been charged with rape and making death threats against an employee of a beauty salon in Dakar.
Sonko, 48, said he went to the salon for a massage for chronic back pain and denies any assault.
Sonko is believed to be in the southern city of Ziguinchor, several hundred kilometers from Dakar, where he is mayor.
When Sonko was arrested in 2021, several days of protests left at least 12 people dead.
Three other people died during clashes between Sonko supporters and police ahead of the May 16 proceedings.
In March, Sonko was sentenced to a six-month suspended prison sentence for defamation and insults against the tourism minister.
Sonko, president of the PASTEF-Patriots party, came in third in the 2019 election against incumbent Macky Sall.
Political tensions have also been stoked by Sall's refusal to rule out running for a third term as president, a move his opponents say would be unconstitutional.