A sweeping bill to prohibit discrimination against homosexuals in the nation's largest city has opened deep religious and social divisions here, as opposition by the Roman Catholic Church and orthodox Jewish groups intensifies.

A City Council hearing today turned ugly as dozens of Hasidic Jews, wearing traditional black hats and garments, heckled and cursed Mayor Edward I. Koch, Broadway producer Joseph Papp, labor leader Victor Gotbaum and other advocates of the bill.

Late tonight, the council's General Welfare Committee voted 5 to 1 to approve the gay-rights bill, which had been bottled up there for 12 years. The measure now goes to the 35-member council, which is about evenly divided on the issue.

More than 50 cities, counties and states have ordinances prohibiting some forms of discrimination against homosexuals. Washington's comprehensive human rights ordinance covers homosexuals. Maryland law prohibits public employment discrimination.

In an attempt to circumvent the council, Koch had enacted an executive order prohibiting discrimination against homosexuals, but the order was overturned by the State Supreme Court last summer after the Catholic archdiocese filed suit, claiming that it would require Catholic day-care centers to hire homosexuals. The court ruled that only the City Council had the power to enact the measure.

In recent weeks, Cardinal John O'Connor and Brooklyn Bishop Francis Mugavero have led a lobbying effort to defeat the bill. In a statement last month, they said that it would "seriously undermine" the "values of our youth and the stability of the family in our society."

More than 350 people packed the ornate council chamber today. When Koch stood up to speak, more than 50 Hasidim rose to their feet, turned their backs on the mayor and drowned out his statement with boos.

The bill, Koch said, would "prohibit discrimination in employment, housing and public accommodations," exempting businesses with fewer than four employes, owner-occupied dwellings and religious organizations.

When Papp, founder of the New York Shakespeare Festival, testified for the bill, listing dozens of purportedly homosexual figures from Plato to Michaelangelo to King James I of England, a man in the audience shouted, "I hope you die of AIDS." He referred to acquired immune deficiency syndrome, a deadly disorder for which male homosexuals are at high risk.

Papp turned to his hecklers and said that he was a "good friend" of Rabbi Menachem Mendel Schneersohn, the Hasidic group's leader.

"I've been responsible for getting him on television more times when he couldn't get on," Papp said. "So I am embarrassed by my fellow Jews, who should be thinking about Germany and what happened in Germany."

As Papp walked out of the hearing room amidst angry shouting, a young man thrust a photograph of the Rev. Jerry L. Falwell in his face. Falwell is the leader of the Liberty Federation, formerly known as the Moral Majority.

Playwright Harvey Fierstein, an avowed homosexual, later testified that he had graduated from a Yeshiva, or Jewish religious school, and cries of "Shame!" rose from the audience.

Speaking for the Roman Catholic archdiocese, Brother Patrick Lochrane said that the "primary purpose of this bill is to achieve legal approval for homosexual and bisexual conduct and activity -- something that is totally abhorrent to people of almost every religious persuasion."

If it passes, Lochrane said, the city's public schools, which have courses on "harmonious intergroup relations," "will attempt to teach children of an impressionable age that homosexuality and bisexuality are acceptable alternatives."

City Councilman Noach Dear, a leading opponent of the bill, warned that "it could open up a Pandora's box of other life styles, like bestiality."

Episcopal Bishop Paul Moore, Sen. Daniel Patrick Moynihan (D-N.Y.) and Gotbaum, of the American Federation of State and Municipal Employees, endorsed the bill.

"We're presenting it as a measure of decency," Gotbaum said. "All people have a right to express their emotions."