Nothing outside Tokyo's 24 Kaikan hotel hints at what goes on behind its grey concrete walls. Tucked in off a back-street near the Shinjuku business and shopping district, the seven-story building could be an apartment block for retired civil servants. A steady stream of customers in the salary-man's uniform of dark suit, sensible shoes and winter overcoat files quietly through its innocuous doors. Only in the lobby, cheerily adorned with scenes from a sex movie that depict a portly company president being diligently serviced by a young apprentice, does it become clear that this is one of Asia's biggest gay landmarks.

Past the ticket machine – 2,600 yen (about £18) for a 13-hour stay – and pretty much anything goes, say guests who come from across Japan, and even abroad, to sample its treats. Soak in the sauna/bathtub then make your way up semi-naked through the floors, where porn flickers 24 hours a day in dimmed communal sleeping areas equipped with futons. Wander around and watch the sights or lie back and wait for someone who fancies you, instructs one guide, which blissfully advises customers to expect "some mind-blowing tableaus". Amid the satyric excess, bilingual signs posted throughout telegraph the only constantly visible rule: "Gentlemen who chew gum" will be evicted from the premises.

It is, in many ways, very Japanese: discreet, compartmentalised; fastidiously careful about order and details. Live and let live as long as the outward appearance of things is maintained. "This is a country that happily lives with contradictions," says Taq Otsuka, author of several books on Japan's gay scene. "It has its one way of doing things that people sometimes don't understand." Thus, Tokyo, a city with a reputation as one of the most uptight, buttoned-down capitals, also boasts, in its Shinjuku district, one of the world's densest and most diverse concentration of gay bars and clubs: the Ni-chome (pronounced "nee-chomay") area.

Roughly 300 businesses, including the 24 Kaikan, are squeezed into Ni-chome's couple of blocks, from sex shops to watering holes that cater to a staggering array of tastes – known in Japan as kei (speciality). Bars for overweight men, transvestites, spankers, the hirsute, the young, men over 70, older men who want to be with younger men; with names such as Popeye, Tarzan, Duke, Brutus and Bambi. One establishment specialises in guys who look like pin-up idols; another reportedly caters to clientele from the countryside. "I've even heard of one place that is for busaiku-kei [ugly men]," laughs Otsuka, who has run local institution Tac's Knot bar for 28 years. "There isn't much you can't find here."

But, roughly half a century since it emerged as a refuge for homosexuals in what was formerly a red-light district, the block is in decline. The local commercial organisation that promotes Ni-chome estimates that the number of gay bars in the area has fallen by at least a third in the past decade. The once exclusively male gay clientele is filled out at the weekends with the straight, the female and the simply curious. "Are gays vanishing from Shinjuku Ni-chome!?," wondered one of the country's most popular magazines recently."This used to be a place for communicating with and discreetly meeting like-minded people," explains the organisation's head Mitsuo Fukushima. "Now there are many other ways of communicating."

Last year, artist Susumu Ryu tried to document the decline in a 276-page manga comic with the clumsy English title, "Vanishing Shinjuku Ni-chome – who severed the jugular of a flower garden of heretical culture?" Ryu blames gentrification associated with the opening of a new subway line, which has pushed up local property prices and made many of the tiny bars here unviable; and the rise of the internet, which has given men with secret lives a way to navigate the world. Instead of cruising bars for strangers, they can now hook up online and arrange to meet in a love hotel or apartment. He cites the 2004 closure of the famous gay magazine Barazoku after 33 years as a key moment. "That was a symbolic event when the internet overtook gay culture here." Recession hasn't helped: many of the bars demand a cover charge of up to 1,000 yen (about £7).

On a Saturday night, though, the decline is not immediately obvious. Crowds and taxis throng through Ni-chome's streets, and clubs and bars fill up after 11pm. But many businesses are clearly struggling. In Sazae, a retro-themed disco for cross-dressers, men trickle in, wearing suits and civvies, change into dresses and don wigs in the toilet, then dance and pair off. Like many of these bars, the master – a middle-aged queen with a passion for 1970s soul and funk – sets the atmosphere and discreetly regulates the clientele. "Business has certainly peaked," he laments, grimacing unhappily. "It used to be packed here and you can see what it's like now," he says, sweeping a hand around the half-empty bar. "The customers are getting older, too."

Fittingly, perhaps, as he shouts over the noise of the disco, Gloria Gaynor's great gay anthem "I Will Survive" comes pounding out of the speakers.

Ni-chome partly mirrors the changes in Japan's gay culture. Until the 1980s, says the 62-year-old Otsuka, the area – 10 minutes walk from Tokyo's busiest transportation hub – was an escape for men who were often married and hiding their sexuality. "When I came here first in my twenties, everybody used fake names and it was just accepted that you were going to be unhappy," he recalls. "Even couples came separately. The idea that gay people could share a life together was a fairy-tale." Adds Mark Oshima, a Japanese-American who came to live in Tokyo two decades ago: "In the old days, everyone got married – as long as they had respectable lives on the surface, they could live a double life."

Though blighted by the typical agonies of personal identity and need for secrecy, gays and lesbians in Japan nevertheless did not suffer the same outright repression as those in other parts of the world. Discrimination in Britain and the US, at least until the 1960s, was "horrendous", points out Mark McLelland, a UK-born academic and author of Homosexuality in Modern Japan: Cultural Myths and Social Realities. "You could be prosecuted there, whereas the Japanese are fairly laid-back about sexual scandal – it's not personally harming in the way it is in the West."

While British cops were still busting men in public parks, Japan didn't even have an anti-sodomy law, nor what McLelland calls the "anti-homosexual rage" of many Christian cultures, the lethal fuel for homophobia and the "hyper-violence" of gay-bashing incidents. As Otsuka puts it: "Homosexuality was never considered a sin here, just shameful."

But if Japan was more laid-back about its sexual preferences, it also lacked the political and social frisson that helped transform the lives of homosexuals elsewhere. Gayness was, and is still, largely seen as a personal lifestyle choice, not something to be flaunted or argued over on the streets and in parliament. Otsuka says he sometimes looked with envy at the battles for gay equality in other parts of the world. "It seemed very extreme and frightening, but I admired how you could shout your identity from the rooftops, and tell everyone that you were in a gay relationship."

He began writing about what was happening abroad and set up his bar to lead by example. "I learned the English phrase 'coming out' and told people about it. I was in a long-term relationship and I wanted to show others it was possible, if they had courage. When my partner died of Aids [about 10 years ago], there was a lot of ignorance about the disease, so I spoke about that too, though it was very hard for me."

Today, men in Ni-chome are far more likely to use their real names and announce their same-sex relationships to the world – or at least to the clientele of their favourite club. But progress has been tortuously slow, and many gays and lesbians are still living a lie, says David Wagner, a business consultant and 24-year veteran of the Ni-chome district. "It's the Stone Age here. This is one of the biggest cities in the world but the gay scene is pathetic. The Sydney gay parade has maybe 500,000 people marching every year – Tokyo has maybe 3,000, when it happens." He still meets many gay men who are lying to their families about their sexuality. "I say, 'If you all came out the same time, everything would change.'"

Homosexuals are still not legally recognised in Japanese civil law, civil unions are prohibited and there is, as yet, not a single openly gay law-maker or prominent business person, admits Kanako Otsuji. A lesbian activist, in 2007 she ran as the country's first openly gay candidate in a national election, after publishing her biography Coming Out. "There is a saying in Japan: 'to put a lid on something that smells,'" she points out. "The topic is ignored and disregarded. You don't touch it. But this is still not a bad place to be homosexual."

Indeed, young gays hopping from club to bar around Ni-chome find bewildering Otsuji's struggles to change society, or force it to acknowledge their sexuality; one reason, perhaps, why she came near the bottom of the 2007 poll. Many have never heard of her or the landmark 1969 New York Stonewall riots, or taken part in the Tokyo Pride parade, which limps into action some years and other years doesn't happen at all. But many accept that their lives have been transformed since the last generation of gay corporate samurai fled here from tormented lives.

"I came out to my parents when I was 11," remembers Yusuke Takane, a 23-year-old university student sipping a drink in Arty Farty, one of the district's most popular clubs. "I don't know what it means to be hiding." His experience living abroad has convinced him that Japan is friendlier to gays than elsewhere. "I lived in France and people there shouted 'pede' ('fag'). I couldn't imagine that here, especially not in this area. That's why I come here, even though I can meet people on the internet – I feel comfortable."

Few seem worried or even aware that Ni-chome may be dying. But among many proprietors, the talk is of little else. Some speculate that Tokyo's famously right-wing governor Shintaro Ishihara, irritated by the area's reputation for sexual freedom and occasional debauchery, may have a hand in its decline, but there is no proof of that. "He doesn't have to crush Ni-chome," says Wagner. "It's imploding."