Wedged between liberal South Africa, which allows gay marriage, and conservative Zimbabwe, where President Robert Mugabe regularly lambastes gays, Botswana has emerged as a testing ground for competing visions of African social values.
The court case was filed on March 4 by Caine Youngman, founder of a group called Lesbians, Gays and Bisexuals of Botswana (Legabibo), which the government refused to register in 2009.
He argues that the sodomy law violates his constitutionally protected freedom of expression, and he has won support from the Botswana Network on Ethics, Law and HIV (Bonela) and other civil forums.
"I never freely express my sexuality because of the law that criminalises sex between people of the same sex," Youngman said in an affidavit.
He originally announced the lawsuit two years ago, but delays in gathering paperwork for the court meant it was only filed early this month. During that time, Botswana's gays received an unexpected - if cautious - voice of support from no less than former president Festus Mogae.
As head of the National Aids Council, Mogae last year began speaking out against sexual discrimination, saying prejudice was hindering efforts to fight HIV in a country where one in four adults had the disease. "We do not want to discriminate. Our HIV message applies to everybody," he said last year in his first remarks on the issue.
"If we are fighting stigma associated with sex, let's apply it to sexual discrimination in general," Mogae said.
He has continued speaking out, telling the BBC last weekend that during his 10 years in office he had instructed police not to arrest or harass gays.
"I could not change the law because that would be unnecessarily stirring up a hornet's nest. I was not willing to lose an election on behalf of the gays," he said.
"The majority of our people are still opposed (to homosexuality) so I must convince them first before changing the law unilaterally," he said.
But the backlash has been vocal.
Parliament's deputy speaker, Pono Moatlhodi, told local media that gays were "demonic and evil" and had no place in African society.
"On this point I would agree with Zimbabwean President Robert Mugabe who once described such behaviour as that of Western dogs," he said. "I don't like those gay people and will never tolerate them. They are demonic and evil."
Conservative religious leaders have also claimed that homosexuality runs against Botswana's culture.
"Our nation has done well to keep these legally and customarily unacceptable, and we must resist any suggestions that would lead to homosexual marriages in our nation," said Biggie Butale, head of the Evangelical Fellowship of Botswana.
Such intense debate is rare in Botswana, which prides itself on its stable democracy, but has few public disagreements with a largely homogenous population. The nation's diamond wealth is generally seen as well-managed.
Current President Ian Khama has straddled a middle line, saying he had no problem with homosexuals as long as they "do their things" behind closed doors.
Derision of gays as "un-African" infuriates Youngman, a 27-year-old inspired by the freedoms he sees across the border in South Africa.
"Enough is enough. Gays are Batswana, and were not made in a cocoon somewhere and put in this country to corrupt the Batswanas," he said.
"I need to be free in what I do. Gay people are no different from the rest of the nation and they deserve that freedom."