One day, about 15 years ago, Sunil Mehra’s partner, Navtej Johar, a classical dancer, was being interviewed on the phone at their New Delhi home. The journalist asked about Johar’s sexuality. Mehra waited until Johar had finished, then sat him down and asked him a question: “Navvy [as he calls Johar], do you want to be known as a brilliant dancer? Or do you want to be known as a gay dancer?”

For his entire life, Mehra had refused to be defined by his sexuality. “I am not a professional homosexual,” he says now. “There is much more to my life than my sexuality.” And yet, five years ago, Mehra agreed to shed his privacy to become the first well-known Indian in the country to openly declare that he was gay, putting his and Johar’s names on a writ petition in the supreme court demanding that section 377 of Indian law – which criminalises gay sex – be abolished.

Mehra, 63, is a well-known journalist (the former editor of the Indian edition of Maxim magazine), actor and exponent of dastangoi, a 13th-century form of oral storytelling that has seen a revival in recent years. Johar, 59, travels the world as an award-winning bharatanatyam dancer, choreographer and yoga teacher. Their petition was accompanied by a clutch of others from gay and lesbian personalities who had previously been equally private about their sexuality. If, as is widely expected, the court rules in the next few weeks to legalise gay sex, members of the LGBT community in India will no longer feel, as a lawyer for the petitioners said in court, like “unconvicted felons”.

Why did Mehra choose to propel himself into the limelight? We meet over coffee on a muggy morning in Green Park, a well-to-do Delhi neighbourhood. The air is thick with moisture, but Mehra looks fresh and relaxed. (Johar is performing in the US and speaks to me later on the telephone.) In the course of an emotional conversation, tears often surge up, choking Mehra as he recalls the Delhi high court verdict in 2009 that legalised gay sex, leading to celebrations by tens of thousands of gay people. Mehra himself marked the historic occasion by writing for the BBC website about his experiences during the long journey: “Through it all, it has been an effort to hold one’s head high, walk lonely but proud and repeat ad nauseam to oneself: I’m a good man. I love my family. I take care of animals. I do not lie. I do not cheat. I believe in God. I earn my living. I pay my taxes. And it’s my business who I sleep with.”

‘More than once, we were told by other gay people that we should be role models.’ Mehra and Johar in 1998.

Yet five years later, shortly before Christmas 2013, Mehra found himself sitting in the same coffee shop with friends, trying to digest the fact that the supreme court had overturned the 2009 ruling. Gay sex was once again a criminal offence. They sat there, not knowing whether to laugh or cry. “What could I and all the others do? Go back into the closet?” he says.

The answer came in 2016 when Menaka Guruswamy, a constitutional lawyer friend, suggested it was time to give a human face to the 20-year-old legal battle to decriminalise gay sex; one that until then had been led by various NGOs. “She asked us if we would put our names on a petition,” says Mehra. It was a fraught decision. Mehra and Johar, who have lived together for 24 years, had never been activists or played a public role in the gay rights movement. “More than once, we were told by other gay people that we should be role models, but I always said: ‘My life is not a slogan,’” says Mehra.

The idea of having their names bandied about in court troubled them. But they agreed with the need to send a clear message that there was nothing weird about their relationship: “‘Look, no horns, no tail, no monster, no paedophile. Just a loving couple,’” says Mehra. “We have been OK. I am 63 – we have lived our lives. We had fought for our bit of sun and we found it. It was more for all those who didn’t have our class privileges, education, intellect, money and connections to insulate them. It was so that these other lives could be lived in the sun, rather than in burrowed, dark spaces.”

The law on gay sex, which dates back to 1861, has not exactly led to Indian jails being packed with gay people – about 200 men are believed to have been prosecuted in the last 150 or so years. After all, to prove that gay sex has taken place, somebody has to witness the act. And yet “having carnal intercourse against the order of nature” remains a crime punishable with a life sentence, casting a shadow over every gay person’s life and leaving them vulnerable to blackmail from strangers, ex-lovers and even the police.

The hearing into the petitions began earlier this month. Gone were the technicalities and definitions of earlier proceedings, the graphic dissection of gay sexual positions and the denunciation of homosexuality as a psychiatric disorder. This time, the exchanges were suffused with humanity and compassion. One of the five judges was seen wiping away tears.

Mehra came home after attending the hearing and told Johar that there was something “electric” in the courtroom atmosphere. “I could feel waves of positive energy coming towards me,” he says. He was in the packed court the day Guruswamy narrated the story of their relationship to the judges. She said that, as a young man, Mehra had passed the tough entrance exam to join the civil service – a high-status job in India. Mehra did not take it up, for fear that his homosexuality would become known. The risk of being blackmailed, shamed or humiliated was too great.

In court, Guruswamy told the judges: “Twenty years of their lives have gone. They have been forced to live insecure, vulnerable lives. Can we at least ensure that those who are younger have a better life?”

Although Mehra has been cushioned by his relative privilege, he moved in circles where prejudice still lurked in the unlikeliest of places. He recalls an editorial meeting at a magazine he was associated with. The subject was a possible cover story on homosexuality. The magazine’s editor was well-travelled. “The idea didn’t really work out and at the end of it, the editor casually said: ‘Drop it. Let’s face it – they’re deviants.’ I was stunned,” says Mehra.

Johar has had an easier time working among creative people. “Dance is quite gay-friendly, even in India … but even within my yoga circles, I felt accepted,” says Johar. “My guru knew. He was most accepting and came and stayed with Sunil and me many times.”

Neither man was bullied at school. As a teenager growing up in Jaipur, Mehra was so accomplished at putting on a front as “one of the boys” that he acquired a reputation as a “ladies’ man”. His wit, charm, charisma and gift as a mimic protected him.

By contrast, Johar’s conservative, orthodox Sikh family in Punjab, a community known for its macho male culture, struggled with the fact that he wanted to be a dancer, let alone that he was gay. Johar knew very early in his life that he didn’t fit in. “I must have been about five when I could sense I was different,” he says. “I learned to be super-discreet. My father was a tall and towering figure who loved sports, and was disappointed that I wasn’t at all sporty. But he never, ever, berated me for not being manly.”

Johar first came out to his sister, a psychologist, when he was 18. “I had been madly in love, and love is very affirming. I couldn’t see how something so beautiful could be wrong,” he says. His father died when Johar was 21, seemingly oblivious to the truth about his son.

My sister said to me: ‘How could you? How could you think that I would not love who you love?’

But what parent doesn’t guess? “Many decades after his death, I was told there was a standing order in the family not to leave me alone, ever, with the servants [for my own safety]. So, he knew. Of course he knew. And this was his way of being protective. I cried when I learned this,” says Johar.

Mehra’s coming out was more turbulent. He was 38 when a two-year relationship came to a bruising end. He had a breakdown and ended up in hospital. He turned to his friends, who had no idea he was gay, for help. They disowned him. “One of them said that it would have been better if I had died. They told me to wipe the slate clean and start afresh with a new set of friends,” he says.

That’s when he told his family he was gay. “My sister said to me: ‘How could you? How could you think that I would not love who you love?’” His brother and mother accepted the news.

In 1993, he was asked to write a profile of Johar and went to a performance. After five minutes of watching Johar dance, Mehra was bewitched. The next day, they met for a coffee that became lunch and then rolled into dinner. They moved in together six months later.

In time, Mehra’s family came to love Johar. Mehra recalls how Johar used to shop for clothes for his mother who, he says, enjoyed playing the “arch mother-in-law”. Johar used to buy her the comfy, crumple-proof pyjamas she wanted for the spells when she was poorly. “Her last four months were spent with us in our house,” says Mehra.

Their friends often joke that the affection and respect they show each other puts many heterosexual couples to shame, although they admit to occasional squabbles. Mehra can wake up feeling the business of living with another person is all a bit too much. As for Johar, when a friend once asked him what he would do if he won the lottery, he deadpanned: “I’d send Sunil on a world cruise.”

‘It will feel good to be legitimate, finally.’ Mehra and Johar

Making same-sex relationships work in India is harder than heterosexual ones, says Johar. “When you split up, people are dismissive about the pain; sort of, ‘Go get a cat,’” he says. “And when someone you love dies, you grieve alone.”

If the mood in the courtroom earlier this month was one of optimism, the reason was not only that attitudes have changed in recent years (at least in enlightened urban circles), but that the supreme court itself had laid the groundwork for change. Last August, it issued a ruling that privacy was a fundamental right of all Indians, and sexual orientation was an essential attribute of privacy. Most lawyers and gay rights activists agree that it is virtually a foregone conclusion that gay sex will be legalised when the court gives its ruling before the end of September.

Mehra and Johar had no idea that their story would play a pivotal role in the fight for gay rights. The support from their families has been extraordinary. If anyone thinks that being gay means you can escape the large extended Indian family, they are mistaken. The battalions massed on both sides – aunts, uncles, cousins, nieces and nephews – have been enthusiastically backing their battle in the court.

The two men are confident that, once section 377 is overturned, the logical conclusion will be to allow same-sex marriage, too. But that legal battle will have to be waged by others. Mehra and Johar are leaving Delhi (and its air pollution) for a quieter life, moving into a bungalow in Chandigarh, 150 miles north of the Indian capital, where the air is cleaner. “We’re getting away with the dogs to where both of us can write and breathe easier,” says Mehra. When the verdict they are waiting for comes, they will celebrate. “It will feel good to be legitimate, finally,” says Johar.