That changed when he was about 15 and saw a buddy shot to death on the street after he had assaulted a Colombo captain. “There was a thick snake of blood,” Mr. Carlo recalled, with writerly vividness. “It looked like his lifeblood was crawling out of him.”

Suddenly the underworld did not seem so romantic. Mr. Carlo was in a gang, the 24th Avenue Boys, and one day in a rumble he was shot in the head, somehow escaping with little more than a scar over his left eye.

Dyslexic, with a checkered high school record (he would later spend a year in community college), he found solace in reading, sliding his fingers slowly over the words. He grew his hair long and moved to Manhattan, supporting himself, he acknowledged ruefully, by selling marijuana. He graduated to real estate and, in 1976, bought his brownstone in the West 80s, between Riverside Drive and West End Avenue, for $80,000.

Then he began to write. Rather than rely on the shock value of his story lines, Mr. Carlo sought to infuse his prose with soul. As he put it: “A lot of what occurs in writing is between the lines. It is not the lines.”

He got the idea for his first book when he was hospitalized at Bellevue with an infection and a woman was murdered there. He spun it into a thriller about a killer loose in the wards. He collected 125 rejection letters and shelved it forever.

Disillusioned, he decamped for Europe, where, in Amsterdam, he said he was shocked to see children performing sex shows in shop windows as police officers stood by. He studied the sex trafficking of children and, in a sidewalk cafe in Ibiza, scrawled out another novel, this time about the kidnapping of a American girl in Pompeii by a child pornography ring. After 10 rejections, Dutton published it as “Stolen Flower” in 1986. Universal optioned the book for Mr. De Niro, and the two men spent weeks scouting movie locations. Five scripts later, the project languished. But Mr. Carlo became a frequent television guest and lecturer on the sex trade.

After Mr. Ramirez, the Night Stalker, was convicted in 1989 of 43 crimes, including 13 murders, Mr. Carlo wrote him on death row, seeking material for a novel about a serial killer. A correspondence blossomed, and the novel turned into nonfiction. Mr. Carlo’s 1996 chronicle of Mr. Ramirez’s troubled early life and brutal crimes drew strong reviews  Publishers Weekly called it “exceptionally well-told”  and has gone through 23 printings.