A quick-thinking Sayville boy helped cops nab a convicted pervert who followed the youth down a quiet neighborhood street and masturbated in front of him, police said yesterday.

Cops arrested Stephen Claussell, 26, of Selden on Monday afternoon after he allegedly trailed the boy several times along Railroad Ave., all the while exposing himself to the boy, police said.

The boy "flagged down a nearby resident and used their cell phone to report it to police," Suffolk County Police Detective Lt. Edward Reilly said.

As officers arrived and started to question the boy, Claussell drove by again in his black Hyundai Santa Fe sport-utility vehicle.