Some cops in Brooklyn got a nasty trick on Halloween night.

A wild crowd of revelers turned the holiday into a hell night as they dumped piles of trash onto a cop car in Brownsville and onlookers shouted, “Trick or treat, motherf- —rs!”— in the latest incident of disrespect to police, according to video footage and witnesses.

Stunning video shows nearly a dozen cardboard boxes and other garbage — including cracked eggs — strewn across the top of a police vehicle parked on East 95th Street near Clarkson Avenue at around 7 p.m. Thursday, according to police and the video.

As two officers — who had been dealing with a domestic abuse call — yanked the trash down, passersby laughed and mocked them, according to the footage, which, adding insult to injury, went viral on Facebook Friday.

“This what happens in the hood. Police get trashed!” a man shooting the video can be heard snickering. “Oh man, look at that.”

In the distance, a second onlooker shouts, “Trick or treat, motherf—-rs!”

All of the trashing of the vehicle happened while the 67th Precinct officers were inside a building for about 20, dealing with a follow-up on the report of domestic violence, sources told The Post.

Police said Friday that they are investigating the incident and that “additional resources will be deployed to address the conditions in the neighborhood.”

“The inmates are running the asylum. There is no respect for cops,” said one angry police source. “What these morons don’t realize is that they are only hurting their neighbors, who might seriously need a cop for an emergency.”

Ali Abdul, 25, a worker at a nearby bodega agreed.

“I come out outside and everything was on the car — boxes, garbage. I don’t know if it was a prank … It was adults,” he said. “It’s not right.”

The cop-trashing comes after months of hostility directed at NYPD officers, including incidents in which brazen young men in Harlem and Brownsville drenched police officers with buckets of water

In another case, a member of a wild mob in the Bronx tossed a tin of Chinese food at a plainclothes cop while officers tried to make an arrest in August.

The man who posted the video of the trashed cop car, who goes by Corey Sykes on Facebook, didn’t return a request for comment Friday.