NEW YORK -- Four years ago, city officials placed Christine Gay and her three children in a pair of bunk beds in Manhattan's run-down Martinique Hotel, where they are one of 400 homeless families living behind 15 floors of barred windows overlooking Broadway.

Since then, no one has paid much attention to Gay, whose children play amid the drug dealers and double-parked cars on West 32nd Street, and the city has routinely paid the Martinique $1,590 each month for her cramped room.

But suddenly, the fate of Gay and people like her is at the center of a political storm here. Federal officials in Washington are threatening to cut off funding for people who, like Gay, spend months or years in dilapidated welfare hotels, some costing $100 a day.

Mayor Edward I. Koch wants to disperse the problem by building 10 shelters in the boroughs outside Manhattan. But local leaders in Brooklyn, Queens and the Bronx are in an uproar, saying that the huge shelters will ruin middle-class neighborhoods without making a dent in the homelessness problem.

Under siege from all sides, Koch has shifted to another battle front by announcing that the city will begin sweeping mentally ill people off the streets and involuntarily hospitalizing them if they are incapable of caring for themselves. Local health officials say that this would overwhelm the city's public hospital system, where the mentally ill now wait for days in emergency rooms and hallways because no beds are available.

Welcome to another round of the politics of the homeless, New York-style. It is a parochial world in which Staten Island is spared a shelter for the homeless by agreeing to accept a jail, while Brooklyn and the Bronx are slated for four shelters apiece because their borough presidents refused to make deals with Koch.

It is a world in which the irrepressible mayor declares himself the city's "No. 1 social worker," but puts forth a plan that his own aides acknowledge depends on state government to admit more homeless patients to its psychiatric hospitals, something state officials have been unwilling to do.

New York City now provides shelter for 27,000 homeless people, a population greater than that of Gaithersburg. Another 30,000 or more are estimated to be sleeping on street corners and in subway stations. The number of homeless has multiplied throughout the 1980s, driven by a critical housing shortage, two recessions and a near-emptying of state mental hospitals.

Faced with a series of court orders, New York has chosen to house the homeless in faded hotels such as the Martinique, where one-sixth of the city's 12,000 homeless children live. There are no cooking facilities in such hotels, and the federal meal subsidy for these families -- 71 cents per person per meal -- won't even buy a Big Mac and fries.

Gay, who was forced onto the streets when a new landlord raised the rent on her Queens apartment, says life in the Martinique has been hard on her children, aged 11, 9 and 7. Although the hotel is just two blocks from Macy's department store, the pushers outside "sell drugs in broad daylight," Gay said. "People in the hotels buy them. The guards, all of them, smoke crack."

Despite such conditions, the welfare hotels are so crowded that the city has been forced to send some of its homeless to motels in New Jersey.

The federal Health and Human Services Department, which pays half the cost of these hotel stays, says it will cut off emergency aid for any person who remains in a hotel for more than 30 days, a stance that will also affect the District of Columbia and other cities. Wayne A. Stanton, administrator of HHS' family support administration, singled out New York in announcing the proposed regulations, and accused the city of running a "rip-off operation" by housing the homeless in "very deplorable" conditions.

Extended hotel stays "are clearly outside the law," said Stanton, who also wants New York to repay $80 million it already has spent. That includes homelessness aid the city has used to renovate vacant apartments, which almost everyone here agrees would provide the most permanent solution.

Koch sparked the debate by pushing a $100 million plan to build new shelters in four boroughs, saying the city cannot afford to renovate more than a few thousand apartments each year. At first the plan faltered in New York's powerful Board of Estimate as the four borough presidents rallied in opposition, prompting Koch to threaten to place the homeless in high schools.

The mayor prevailed when Manhattan Borough President David Dinkins, who had commissioned a critical study called "A Shelter Is Not a Home," lent his support in return for promises that Koch would drop one of the two shelters slated for Manhattan and empty five downtown welfare hotels.

The other borough presidents were outraged. Brooklyn's Howard Golden accused Koch of cutting "back-room deals . . . to satisfy his personal pride."

Queens Borough President Claire Shulman, who supports permanent apartments for the homeless, said Koch's planned shelters are little more than welfare hotels. "To take Manhattan hotels, which are an abomination for children, and move them to the other boroughs, you're just changing the sites," she said.

Shulman said Koch had offered to drop one of the two shelters planned for Queens in exchange for her support. "I just couldn't do that," she said. "I don't think it's a good way to run a government."

Koch's plan to involuntarily hospitalize hundreds of mentally ill homeless people was unveiled to favorable publicity. Within days, however, city officials were forced to concede that the 1,110 acute-care beds in its public hospitals were filled, and that the mentally ill must wait an average of 24 hours or more to be hospitalized.

"At Bellevue Hospital last week, 17 people were waiting for beds in the emergency room," said Robert Hayes of the Coalition for the Homeless. "Some were handcuffed to wheelchairs, some were under police guard. Homicidal and suicidal people have been turned away . . . . Koch's plan is such a joke to people in the field."

City officials said the homeless would be served by a new 28-bed intake unit at Bellevue, but those needing long-term care would still have to be moved to state psychiatric hospitals.

"In theory, the patients have to be transferred to a state facility," said Dr. Luis R. Marcos, a vice president at the city's Health and Hospitals Corp. "The state should open its doors to these patients."

In the past, however, these hospitals have accepted only 40 percent of the homeless mental patients referred by the city. Marcos attributed this to a reduction in state psychiatric beds here from 13,000 to 4,000, and said that this has forced the city to keep some homeless patients in its acute-care hospital wards for months or years.

State officials have made no promises about changing their policy and say the root of the problem is the city's lack of affordable housing.

This has set off a new round of finger-pointing, with some state officials lambasting the city's treatment of homeless patients and Koch calling the state psychiatric system "a snake pit."

What is most striking about the homeless problem here is its continued growth even as the city's economy is booming: unemployment has dropped to 5.1 percent. Yet two-thirds of the homeless here are families, and an entire city shelter in Brooklyn is filled with employed single men.

No matter how many shelters the city builds, Hayes said, they will be "swamped" because an estimated 250,000 families are doubled or tripled up in apartments with relatives or friends. "Do we keep our finger in the dike by running rather shabby shelters," he asked, "or do we bite off the housing shortage that causes homelessness?"

Despite the politicians' promises, Christine Gay expects no early exit from her dreary life at the Martinique. "There's 52 rooms on each floor with a minimum of three people in each room," she said. "Where are they gonna put them all?"

Staff researcher Marianne Yen contributed to this report.