A federal appeals court on Thursday reinstated a lawsuit by an NYPD officer, who claims he was punished for speaking out against arrest and ticket quotas.

Police Officer Craig Matthews — who made headlines in 2012 for taking down a killer gunman in front of the Empire State Building — had his complaint tossed 18 months ago by a Manhattan federal judge, who said the cop wasn’t owed First Amendment protection for complaining on the job.

Matthews claimed he was targeted for retaliation and unjust work evaluations because he spoke out about quotas, which the NYPD has denied exist.

The 2nd Circuit Court of Appeals said Matthews spoke to commanders just like any ordinary citizen would have the right to do, during any number of regular meetings the brass has with the public.

“We conclude that because Matthews’ comments on precinct policy did not fall within his official duties … he spoke as a citizen,” the appeals court ruled. “Accordingly, we vacate the district court’s grant of summary judgment and remand for further proceedings consistent with this opinion.”

The appeals court conceded that Matthews had much more access to 42nd Precinct stationhouse brass than the average Bronx resident.

Still, that shouldn’t matter in the big picture, the federal appeals court ruled.

“We do not consider the relative degree of access to be material; rather what matters is whether the same or similar channel exists for the ordinary citizen,” the court said in ruling for Matthews.

Before this lawsuit, Matthews was best known for his role in bringing down laid-off designer Jeffrey Johnson, after he shot and killed former co-worker Steve Ercolino outside 10 W. 33rd St. on Aug. 24, 2012.

Bystanders followed Johnson and caught the attention of Matthews and partner Robert Sinishtaj, who shot and killed the gunman in front of the iconic skyscraper.