A bystander egged on the Trinitarios gangbanger who shot an NYPD cop before he was killed by officers during a wild shootout in an upper Manhattan parking lot, a cellphone video shows.

“Don’t give up! Shoot all them n—as!” the man can be heard shouting on video.

“F–k ’em! Shoot the cops! Don’t give up — just shoot!” he says. “Shoot n—a, shoot the cops! F–k ’em!”

The bystander at one point wishes death upon the officers at the scene, the video shows.

“I hope all y’all die,” he says, before ordering the gangbanger to “shoot back!”

“Don’t give up!”

The man was standing near 4388 Broadway in Washington Heights — right across the street from where the shootout was unfolding — when he began berating the cops, police sources said.

“This guy has to be the biggest moron in the world,” said one source. “He’s lucky to be alive.”

The man can be heard yelling at the responding officers as they communicate with shooting suspect Luis Leizado, who was killed, in an attempt to get him to surrender.

“Drop the gun and come out with your hands in the air,” a cop says over a loudspeaker.

“Nah, don’t drop it!” the man replies. “Shoot them n—as!”

It’s unclear what happened to the man after the incident.

Sources told The Post that cops were sharing the video of the bystander Friday on social media “to let everyone know what a piece of s–t a–hole this guy is.”

“Let’s make this outstanding piece of s–t famous,” read one Facebook post, which featured a screengrab of the man.

The cop that got shot Thursday — Justin Vartanian, 34 — took a bullet to the arm and wound up spending the night at Mount Sinai St. Luke’s hospital. He was released Friday and expected to make a full recovery.