The Namibian High Court is set on Thursday to rule on an application for the right of non-Namibian same-sex spouses to live and work in the country.
It is the latest legal battle with the government in a country where homosexuality is illegal and authorities refuse to recognise marriages from outside the country.
Last year, two couples challenged the government's decision to deny their non-Namibian spouses work and residence permits on the grounds of their same-sex marital status.
"These couples are suing so that their same-sex marriages that are concluded in countries where it's lawfully permitted be recognised by Namibia and for the foreign-born spouses to be afforded the same immigration rights as heterosexual couples," Omar van Reenen, an activist with the Namibia Equal Rights Movement, told AFP Wednesday.
The rights group accuses immigration authorities of selectively applying the law and what it calls "state-sanctioned homophobia".
Immigration laws are clear that "as long as you are a spouse lawfully married to a Namibian, you are entitled to live, work and study in Namibia without permits," Van Reenen said.
One of the couples is Namibian citizen Johann Potgieter and his South African husband, Daniel Digashu, who were married in South Africa in 2015.
The second case involves Namibian Anette Seiler-Lilles, who has been married to German citizen Anita Seiler-Lilles since 2017.
Their lawyers said their cases are not about changing the law to make it legal for same-sex couples to get married in Namibia, but about recognising such marriages celebrated elsewhere.
Homosexuality is illegal in Namibia under a rarely enforced 1927 sodomy law dating to its period of South African rule.
Last October the Namibian High Court granted citizenship to a gay couple's two-year-old son, ending a legal battle over surrogacy and same-sex parents.