NEW YORK - NY1 and the New York Post have won their Freedom of Information lawsuit against the de Blasio administration, arguing that emails between City Hall and a private consultant, Jonathan Rosen, should be made public.

The decision came Thursday morning from a state Supreme Court judge.

For more than two years, the station has been seeking emails between the mayor and Jonathan Rosen, one of his "Agents of the City."

Rosen runs the public relations firm BerlinRosen, which represents real estate developers, unions and nonprofit groups, clients with business before the city.

• READ THE FULL DECISION IN PDF FORM

Emails the mayor exchanges with people outside of government are normally subject to the Freedom of Information Act, known as FOIL, but in this case, the city was saying no.

Rosen was one of five outside advisers that the mayor's former counsel, Maya Wiley, dubbed an agent of the city.

The mayor's legal team has been arguing that Rosen is a consultant to de Blasio, despite the fact that there was no formal consulting agreement.

In court, the city tried to take the conflicts of interest question off the table by arguing they attempted to eliminate it by releasing emails in which Rosen's clients were discussed. But the station, in particular NY1 political reporter Grace Rauh, wanted more – and the law is on her side, a State Supreme Court judge agrees.

The mayor refused to comment on the ruling when NY1 asked him about it.

“Guys, guys you can ask all you want. Here’s what we’re here to talk about. Last call, anyone want to talk about mansion tax? About mansion tax?" de Blasio said. "Everything else you want to talk about, you will get answers to through our press office. If someone has a question on this, ask about this. If you don’t, that’s cool.”

The mayor held that event to talk about his mansion tax proposal, a tax on property sales of more than $2 million.

NY1 reached out to the city and was told that the de Blasio administration intends to appeal the decision.