More than 1,000 New Yorkers attended a community vigil in Brooklyn’s Grand Army Plaza Monday night to honor the lives of two black men and five Dallas police officers who were all shot and killed in the past week.

The peace vigil honored Alton Sterling, who was killed by police in Louisiana, Philando Castile, who was fatally shot by police in Minnesota and the Dallas officers gunned down by a lone sniper during a protest against cop-involved shootings.

“We need the police and the police need the people of this city,” Brooklyn Borough President Eric Adams said.

Thin, white candles were lit and passed around throughout the crowd as local clergymen and elected officials gave remarks emphasizing peace and justice.

“You don’t have to be on two different sides to pursue justice,” said Adams, who was an NYPD officer for 22 years.

Rabbi Joseph Potasnik, of the New York Board of Rabbis, said that, at the end of the day, both law enforcement and civilians want the same thing: to come home safely at night.

“Respect for the law apply to those who wear the badge and to those who face the badge. All communities,” Potasnik said.

Potasnik and several other community leaders led prayers throughout the vigil, sending a message that violence affects communities of all faiths, ethnicities and careers.

Holding two flickering candles, Karen Thornton said it’s important to “show unity for all lives, not just black lives, and to send up a prayer for peace, unity, love and hope for all people.

“No one’s family members should be killed, murdered or shot down,” said Thornton, 55, who’s from Williamsburg.

But Dahlia Goldenberg, another vigil attendee, said systemic racism in the criminal justice system led to the deaths of the police officers.

“When black people get angry about racism, they get angry about the police system,” said Goldenberg, 38, from Prospect Heights. “One person got so angry they became violent.”

Public Advocate Letitia James urged the crowd to embrace each other’s differences.

“Although it might seem that these acts of violence are final or decisive, we can dictate the terms of our common future,” James said. “A future where no American has to live in fear of hate or persecution because of some aspect of their identity.”