The NYPD's Facial Recognition Unit used this photo to catch David Baez, who was arrested in connection to a Bronx assault. View Full Caption DNAinfo

NEW YORK CITY — Socializing online is landing criminals in custody.

Police are searching for suspects' photos on Instagram and Facebook, then running them through the NYPD’s new Facial Recognition Unit to put a face to a name, DNAinfo New York has learned.

Detectives are now breaking cases across the city thanks to the futuristic technology that marries mug shots of known criminals with pictures gleaned from social media, surveillance cameras and anywhere else cops can find images.

“It is the one time something you see on a television show is actually working in the real world,” said one top police official who went from a tech skeptic to a fan.

The official explained how the new technology worked after a recent street robbery where a woman reported her jewelry stolen by her gal pal’s boyfriend. She did not know his name, only that he was likely in photos on his girlfriend's Facebook page.

“We did not have his name, but we found a photo and the Facial Recognition Unit got a hit,” the NYPD official said.

“It saved a ton of time and potentially dangerous investigative legwork.”

The new technology is the latest weapon in the NYPD's crime-solving arsenal that already includes DNA databases, radiological detectors and sophisticated license plate readers. The new investigative entity was formally launched late last year, with eight cops working in teams of four manning the operations.

Facial recognition — which zeroes in on features and extracts size and shape of eyes, noses, cheekbones and jaws to find a match — is now revolutionizing investigations in ways not seen since fingerprint analysis was implemented generations ago.

“It’s really amazing,” said another top cop who has seen detectives arresting suspects based on information gleaned from images.

Take a recent case involving a rash of livery cab robberies in the Bronx where drivers were being held up at gunpoint.

Police said the suspect called for a ride, jumped in the back seat and immediately brandished a revolver, which he pointed at the back of drivers' heads.

The cops were stymied and there was fear that the next robbery might end in violence.

They had a rough description of the man — between 50 to 55 years old and about 5-feet-10, wearing a green army baseball cap and a green Army shirt.

During one of the heists, on Feb. 28, near 515 Rosedale Ave., the cops retrieved a photo of the suspect from a camera on the dashboard of the livery car.

The NYPD's Facial Recognition Unit used this photo to catch Alan Marrero, who was arrested in connection to a string of livery cab robberies. View Full Caption DNAinfo

The detectives shipped the image to the Facial Recognition Unit inside Police Headquarters, where it was scanned through a database of mug shots.

Within hours, they had a possible match — Alan Marrero, 54, an ex-con with a long history including two stints in state prison for burglary.

Facial Recognition hits are not legally considered “probable cause” for cops to make an arrest, but it provides investigators with a roadmap to follow to obtain other photographs to present to victims to identify suspects.

On March 7, four days after the most recent robbery, Marrero was picked up at his home on Bainbridge Ave. and charged with three robberies. He is presently being held on Rikers Island on $25,000 bail.

In Manhattan, several thugs crashed their way into the home of an elderly couple in Washington Heights, beating them until they revealed where they hid their life savings of $30,000. The couple did not trust banks, and the thugs had heard about it.

A surveillance camera in an elevator captured an image of one of the thieves.

The unit’s futuristic software spit out a match along with a name — David Baez, 31, a convicted robber who spent seven years in jail after putting a knife to a subway rider's throat during a robbery. He was paroled in November 2011.

Investigators quickly determined that Baez also fit the description of a thug wanted in the Feb. 9 beating of a Bronx man who was robbed of his cash and iPhone.

Although Baez has not been charged in the Manhattan incident, cops tracked him down and charged him for the Bronx case. Baez is presently being held on Rikers Island, facing at least three years in jail for violating his parole, in addition to robbery and gang assault charges in the February assault.

Facial recognition, however, is not foolproof.

The best results occur when images submitted to the unit are reasonably clear and primarily taken straight on. But with surveillance cameras virtually everywhere now and the widespread popular posting of photos on social networks, the NYPD is increasingly getting its hands of usable photos to help them identify possible criminals.

“We are solving tons of cases now thanks to the technology,” a veteran police official said. “We get a nickname of someone and track him on social media and now we have a photo and then hopefully a name.

“It's really changing the way we operate,” he concluded.