The judge ruled in favor of two unions and a doctors' group who sought to invalidate a vote by the State University of New York's board of trustees to close the hospital.
The hospital is run by SUNY Downstate Medical Center.
The judge said SUNY trustees violated the state's Open Meetings Law by holding a private committee meeting the day before a public vote in February.
A SUNY spokesman said the trustees would meet next week about submitting a closure plan.
Caregivers and lawmakers are fighting to keep the cash-strapped Cobble Hill facility open.
It's the only emergency room in the area.