The neighborhood was evacuated as a precaution.
A police negotiation team also responded and tried for several hours to get Elcock to surrender, but he refused and eventually ran from the home around 7 p.m.
Witnesses said police told the man to drop his gun, but he refused. He then fired one shot at a group of about 12 officers, who returned fire.
Elcock was hit multiple times and died at the scene, Valdes said.
Police cordoned off 20 blocks around 9th Avenue and 23rd Street as police, the sheriff's office, SWAT teams and the Passaic County Prosecutor's Office set up a giant command post at the scene.
Residents were not allowed back into their homes until early Saturday morning.
Officials have not released the dead man's name.