NEW YORK (CBSNewYork) – An appeals court ruled Thursday that the survivor of a same-sex marriage has the right to inherit as a spouse.

A gay rights legal group called the decision the first of its kind at an appellate level in New York.

READ MORE: Strome, Panarin Lead Rangers To Win Over Blackhawks

It’s illegal for same-sex couples to get married in New York.

The appellate court decided, however, that J. Craig Leiby and H. Kenneth Rantfle’s 2008 marriage in Canada was legal. Therefore, Leiby is entitled to being recognized as a surviving spouse.

The two were married after being together as a couple for almost 25 years, court documents show.

Rantfle died in 2008 of lung cancer, leaving most his estate to Leiby.

READ MORE: New York Weather: CBS2’s 12/5 Sunday Morning Forecast

Rantfle’s brother Richard contested the will, saying the marriage violated public polucy in New York.

The appellate court found that New York has a long tradition of recognizing out-of-state marriages. The only exceptions to that rule are marriages that violate “natural law.” Those violations include polygamy and incest.

“Same-sex marriage does not fall within either of the two exceptions,” the judges wrote in their decision.

Gay rights group Lamba Legal, which represented Leiby, hailed the ruling.

The decision “puts to rest the idea that out-of-state marriages of same-sex couples could be vulnerable to attack,” said Susan Sommer, senior counsel for Lambda.

MORE NEWS: LaVine, DeRozan Lead Bulls To Win Over Nets

Should gay marriage be legal in New York? What do you think of the decision? Sound off in our comments section.