Sonko, 48, was accused of raping a woman who worked in a massage parlour in 2021, when she was 20, and making death threats against her.
"With this sentence Sonko cannot be a candidate," said one of his lawyers, Bamba Cisse.
University law professor Ndiack Fall said Sonko could demand a retrial if he turns himself in to authorities.
But Sall's second term has been particularly turbulent for a country usually viewed as one of West Africa's strongest democracies.
Separately, Sonko is appealing against a six-month suspended prison sentence for libel.
Persons:
Ousmane Sonko, Bamba Cisse, Ndiack Fall, Sonko's, Sonko, Macky Sall, Sall, Ngouda Dione, Bate Felix, Sofia Christensen, Estelle Shirbon, Christina Fincher, Matthew Lewis
Organizations:
University, REUTERS, Thomson
Locations:
DAKAR, Dakar, West, Dakar Senegal, Senegal