The gang activity was tied to two previously unsolved Long Island killings in 2021 and 2023, prosecutors said.