A small earthquake rattled the New York City area in the middle of the night Friday morning, startling some residents in an area where earthquakes are rare.