Edith Windsor addresses a news conference in 2012 at the offices of the New York Civil Liberties Union. Ms. Windsor brought a case in which the Supreme Court struck down parts of a federal law that banned same-sex marriage. (Richard Drew/AP)

Decades after the fact, the diminutive self-described “old lady” joyfully recalled the day in 1967 when the love of her life dropped to the ground and asked, “Edie Windsor, will you marry me?”

Her sweetheart presented her with a round diamond brooch. A ring would have raised too many suspicions. Her lover, Thea Spyer, was a woman, and in 1967 the notion of same-sex marriage seemed closer to fantasy than to the most remote reality.

Their engagement would last 40 years, until 2007, when the two New Yorkers were officially married in Canada. By that time, Spyer, then 75, was paralyzed from multiple sclerosis. Ms. Windsor, a retired high-ranking IBM computer programmer, was 77. Spyer had not much time to live, and they decided they could not wait on the United States for the privilege to wed.

When Spyer died in 2009 and left her assets to Ms. Windsor, the estate owed $363,053 in federal estate taxes — an amount far greater than a surviving heterosexual husband or wife would have paid because of exemptions for legally recognized spouses.

Ms. Windsor sued the United States for a refund. Her lawsuit resulted in the landmark U.S. Supreme Court ruling in 2013 that invalidated a portion of the 1996 Defense of Marriage Act, which had defined marriage for federal purposes as a union between a man and a woman. That ruling was followed by an even more sweeping Supreme Court decision in 2015 declaring same-sex marriage a constitutional right.

Ms. Windsor, celebrated as a heroine among advocates for gay rights, died Sept. 12 in Manhattan. She was 88. Her lawyer, Roberta Kaplan, confirmed the death but did not cite a cause.

“If I had to survive Thea,” Ms. Windsor said when the court issued its 2013 ruling, “what a glorious way to do it.”

Edith Schlain was born on June 20, 1929, to Russian Jewish immigrants in Philadelphia. Her father ran a candy store and ice cream parlor that went bust during the Depression.

“Edie,” as she was known, would later recall that she felt attracted to women from a young age but feared revealing herself as “queer.”

After receiving a bachelor’s degree from Temple University in 1950, she married her brother’s friend Saul Windsor, whose surname she kept throughout her life. But the marriage, inevitably and irremediably, was unhappy.

“I told him the truth,” Ms. Windsor later recalled to NPR. “I said, ‘Honey, you deserve a lot more. You deserve somebody who thinks you’re the best because you are. And I need something else.’ ”

They were divorced after less than a year.

Ms. Windsor moved to New York, she said, to “let myself be gay.” But even there, where she received a master’s degree in mathematics from New York University in 1957, she did not feel comfortable expressing her sexuality. When IBM colleagues offered to set her up, she told the New York Times, she would reply that she was “seeing somebody.”

During an evening at a gay-friendly restaurant in 1963, she met Spyer, a psychologist who also was Jewish and whose family had fled the Netherlands before the Holocaust. The two women “danced a hole through the bottom of one” of Ms. Windsor’s stockings, as she later put it.

When they became an item, Ms. Windsor recalled telling Spyer that if after a year “it still feels this goofy joyous, I’d like us to spend the rest of our lives together.”

Spyer developed multiple sclerosis in 1977. Ms. Windsor cared for her as Spyer lost use of her limbs, becoming a quadriplegic. The two women refused to give up dancing, their favorite pastime; Ms. Windsor simply sat with Spyer in her wheelchair and let Spyer lead them across the floor, as she had always done.

Ms. Windsor wrote in her affidavit that “our choice not to wear traditional engagement rings was just one of many ways in which Thea and I had to mold our lives to make our relationship invisible.” Her tax bill on Spyer’s death — which she would not have received, she noted, if Thea had been a Theo — was a particularly grievous final insult.

Years earlier, Ms. Windsor had ventured into the gay rights movement, offering financial support and volunteering her services as a computer programmer. She confessed to the Times that she had long been discomfited by overtly gay men before the Stonewall riots of 1969 helped show her the importance of protest.

But when she strode to the spotlight with her lawsuit, she told the New Yorker magazine, she suffered a moment of panic when she saw the words Edith Windsor v. the United States of America on a filing.

Even before the Supreme Court issued its ruling in her case, the Obama administration decided to no longer defend DOMA. But the decision invalidating DOMA — a law signed by President Bill Clinton that was reviled by progressives and celebrated by conservatives who consider marriage a sacred institution between one man and one woman — proved a turning point.

Writing the majority opinion in the 5-to-4 ruling, Justice Anthony M. Kennedy described DOMA as a violation of due process as well as the right of states to regulate marriage.

“The federal statute is invalid, for no legitimate purpose overcomes the purpose and effect to disparage and to injure those whom the State, by its marriage laws, sought to protect in personhood and dignity,” Kennedy wrote. “By seeking to displace this protection and treating those persons as living in marriages less respected than others, the federal statute is in violation of the Fifth Amendment.”

Justice Antonin Scalia, who died in 2016, wrote a scathing dissenting opinion in which he accused the majority of presenting a story that was “black-and-white: Hate your neighbor or come along with us.”

“A reminder that disagreement over something so fundamental as marriage can still be politically legitimate would have been a fit task for what in earlier times was called the judicial temperament,” Scalia wrote.

“We might have let the People decide,” he continued. “But that the majority will not do. Some will rejoice in today’s decision, and some will despair at it; that is the nature of a controversy that matters so much to so many. But the Court has cheated both sides, robbing the winners of an honest victory, and the losers of the peace that comes from a fair defeat.”

The ruling extending tax and other federal benefits to gay couples applied only to the 13 states that recognized same-sex marriage, as well as to the District of Columbia. The 2015 ruling, also decided by a 5-to-4 vote, legalized same-sex marriage nationwide.

“The fact is, marriage is this magic thing,” Ms. Windsor told NPR. “Forget all the financial stuff — marriage . . . symbolizes commitment and love like nothing else in the world. And it’s known all over the world. I mean, wherever you go, if you’re married, that means something to people.”

In 2016, Ms. Windsor married again, at age 87, to Judith Kasen, then 51, a vice president with Wells Fargo Advisors, who was her only immediate survivor. Ms. Windsor told the New Yorker that she had wished for children “desperately — that was the hardest thing about letting myself be gay.”

As for the right to marry, although it once might have seemed impossible, Ms. Windsor said, “the truth is, I never expected any less from my country.”