On Christmas Day in 1986, Nicholas Guido was sitting outside his mother’s Brooklyn home in his bright red Nissan Maxima, wearing the clean white jacket he had just gotten as a gift.

Two decorated police detectives had used a department database to track down his address, prosecutors later said. They were moonlighting for an organized crime boss who wanted a rival named Nicholas Guido killed.

Instead of the rival’s address, though, the detectives had passed along the address of a 26-year-old telephone installer with the same name. He was the one who was gunned down.

Twenty-eight years later, New York City has reached a $5 million settlement with Mr. Guido’s family as part of an effort to close one of the most startling chapters of police corruption in the city’s history.