Detectives say 20-year old Brett McCoy of Medford drove off the road and crashed his car in a driveway off Middle Country Road in Coram Friday night.
McCoy told police he was trying to get to the nearby police station after getting shot near a friend's residence in Middle Island.
He was able to flee the area in his car.
McCoy is in critical condition after surgery at Stony Brook University Hospital.
He had been shot in the torso.
Suffolk County Police are searching for the gunman.
Get Eyewitness News Delivered