The Episcopal Church, which has been strained by gay-rights issues since the election of an openly gay bishop in New Hampshire eight years ago, is now divided over how to respond to the legalization of same-sex marriage in New York.

As a result, gay and lesbian Episcopalians will be allowed on Sunday to get married by priests in Brooklyn and Queens, but not in the Bronx or Manhattan or on Staten Island; in Syracuse but not in Albany.

That is because the church has not taken a firm position nationally on same-sex marriage, leaving local bishops with wide latitude to decide what priests may do when the law takes effect in New York State. In the state, with six Episcopal dioceses, the bishops are split: two have given the green light for priests to officiate at same-sex marriages, one has said absolutely not, two are undecided and one has staked out a middle ground, allowing priests to bless, but not officiate at, weddings of gay men and lesbians.

The Episcopal Church, known as one of the most welcoming to gay men and lesbians among mainline Protestant denominations, finds itself in an uneasy position on the issue — embracing neither the clear stance against same-sex marriage taken by Roman Catholic, evangelical Protestant, Muslim, Mormon and Orthodox Jewish leaders, nor the supportive position of Reform Jewish, Unitarian Universalist and many liberal Protestant leaders. The Episcopal Church is a small denomination — the church claims 172,623 members in New York State — but is also prestigious and influential.