A Manhattan woman lost her bid to gain shared custody of her ex-partner’s adopted son, despite a groundbreaking ruling by the late Court of Appeals Judge Sheila Abdus-Salaam that redefined parenthood in New York.

Abdus-Salaam wrote the decision in the seminal case, Brooke S.B. versus Elizabeth A., in August, before she died of an apparent suicide earlier this month.

The ruling — hailed as a major victory by the LGBT community — says that non-adoptive and non-biological parents can still sue for custody.

“Where a partner shows by clear and convincing evidence that the parties agreed to conceive and to raise the child together, the non-biological, non-adoptive partner has standing to seek visitation,” Abdus-Salaam wrote. The decision was the late judge’s most famous case.

Businesswoman Kelly Gunn was the first to sue under Brooke last fall when her photographer ex, Circe Hamilton, tried to move to London with the boy. Gunn claimed she had a right to share time with the 7-year-old, whom Hamilton had adopted from Ethiopia after they broke up in 2011.

But Manhattan Supreme Court Judge Frank Nervo ruled Friday that Gunn didn’t have an “unabated plan” to adopt and raise a child with Hamilton. Even though the women had discussed adopting a child together, by the time Hamilton went through with the process, she and Gunn had already split up, Nervo found.

He added that Gunn stated “on numerous occasions that she did not want to be a parent.”

Gunn’s attorney, Nancy Chemtob, said she was “shocked” by the ruling and vowed to appeal.

Attorneys for Hamilton, Bonnie Rabin and Gretchen Beall Schumann, said, “We are relieved for our client and her child.”

“It’s the right decision and especially poignant with the inexplicable loss of Sheila Abdus-Salaam,” Hamilton’s attorneys said.