ALBANY — Two upstate New York women, turned away from a potential wedding site because they are gay, have filed a discrimination complaint, setting up a possible precedent-setting battle involving the state’s new same-sex marriage law.

The complaint with the state Division of Human Rights appears to be a first involving a wedding venue since same-sex marriage became legal in New York in July 2011, according to advocates on both sides of the issue. One prominent gay-marriage opponent said the case could test the breadth of the law’s religious-freedom language.

Melisa Erwin and Jennie McCarthy, of Albany, filed the complaint Oct. 11 after Liberty Ridge Farm said it would not host their wedding next summer. When owners Robert and Cynthia Gifford found out they were a same-sex couple, the women were told there was a problem, McCarthy said.

The Giffords have objections to gay marriage based on their values and religious background, their spokesman said yesterday.

“They feel that their rights are being violated and they’re being discriminated against,” said Jason McGuire, executive director of New Yorkers for Constitutional Freedoms, a group opposed to gay marriage.

But Lambda Legal senior counsel Susan Sommer said it’s well established that a business that serves the public is in violation of New York’s human-rights law if it discriminates on the basis of sexual orientation.