SINGAPORE — Across the British Empire, the laws banning gay sex in the colonies were often so similar that some even shared the same code number. In India, it was Section 377. In Singapore, 377A.

So when the Indian Supreme Court struck down this fall the country’s colonial-era law criminalizing gay sex, Johnson Ong — 2,500 miles away in Singapore — saw it as a call to action. Within days, Mr. Ong, 43, filed a constitutional challenge to overturn Singapore’s version of the ban, arguing that it was “absurd and arbitrary” and “in violation of human dignity.”

“India is such a conservative society — much more conservative than Singapore in some ways,” Mr. Ong said. “So I was like, if India can do it, why can’t we?”

It’s a question that gay rights activists across the former British Empire have been asking themselves in the months since the landmark court ruling in India. For these activists, the Indian decision was not only a victory for the global gay rights movement, but also a stark repudiation of the Victorian-era legacy that has long stifled them.