A police task force arrested two Brooklyn men late Friday night in connection with a string of home invasions on Long Island and in New York City that have terrified residents and become an issue in the campaign for Nassau County executive .