SAN FRANCISCO — Karen Golinski, a staff attorney at the Ninth Circuit U.S. Court of Appeals who became a reluctant litigant in her own gay-rights battle, won a ruling on Wednesday declaring the Defense of Marriage Act unconstitutional.

U.S. District Judge Jeffrey White said DOMA violates Golinski’s equal protection rights under the Fifth Amendment and granted a permanent injunction that would allow Golinski to add her spouse — whom she legally married in 2008 — on her employer-provided health insurance plan.