The victim, Sean Berry, 36, of Bay Shore, died at the scene of the shooting on Kenneth Lane, according to police.
Homicide detectives arrested Quinton Rubin, 36, of 56 Bruce Lane, whom they said entered a trailer at the side of a residence and shot Berry at 4:30 a.m. Rubin used to live in the residence, police said.
Police did not provide the circumstances of Rubin's arrest in a Tuesday evening news release.
Rubin was to be held overnight at the Third Precinct. He is to be arraigned on a second-degree murder charge Wednesday at First District Court in Central Islip.