A gay New York City judge is fighting for his 2-year-old son's inheritance.

Robert M. Mandelbaum has gone to court to challenge a provision in his father's will that could cut his biological son out of the family fortune unless the judge marries the boy's mother.

A proposed settlement over the matter is pending in Manhattan Surrogate's Court. Mandelbaum's attorney declined comment on Thursday.

The 47-year-old judge is the son of a successful Long Island businessman who died in 2007.

Court papers say Mandelbaum's son was conceived using a surrogate mother. He married another man in July 2010, about three months after the boy was born.

A birth certificate lists Mandelbaum's partner as the boy's "Mother/Parent."