Author Gay Talese. (Evan Agostini/Invision/AP)

A legendary journalist befriends a motel owner who spies on people in the rooms he rents to them. He even invites the journalist to watch him watch. The journalist says nothing about this sordid business for decades.

But in the course of their relationship, the motel owner tells the journalist something even more shocking: that he has witnessed the murder of one of his guests.

It’s not the plot of a novel, but the actual experience of Gay Talese, the famed writer and one of the pioneers of a literary style called New Journalism. Talese, 84, recounts his long and bizarre friendship with Colorado motel owner Gerald Foos in a forthcoming book, “The Voyeur’s Motel,” which is excerpted in a lengthy article in the New Yorker magazine this week.

Talese’s story about Foos isn’t just lurid. It implicitly raises several ethical and even legal questions: What’s a journalist’s responsibility when he or she is an eyewitness to criminal activity? Should he report what he knows to the police, thereby exposing a source who has trusted him? Or should the journalist say nothing until he is ready to report what he has learned?

In “The Voyeur’s Motel,” Talese describes how Foos, a voyeur since childhood, soundproofed an attic walkway in his suburban Denver motel and positioned ventilation grates over guest rooms so that he could peer in on occupants without their knowledge. Over several decades, he recorded his observations of his guests’ sexual activities and other behavior in a journal, parts of which he sent to Talese after first contacting him in 1980.

At one point, he invites Talese to the motel, and they both watch silently from the attic as a couple engage in oral sex.

But the story takes an even darker turn when Foos reveals that he may have triggered a murder.

After seeing a guest selling drugs to some local boys, Foos wrote in his journal that he secretly went into a guest’s room and flushed the drugs down the toilet. The missing drugs led to an argument between the man and his female companion, and Foos wrote that he watched from the attic as the man strangled the woman. Foos said he learned the next day from a hotel maid that the woman was dead in the room and that the man had fled. He said he called the police immediately and provided information about the couple but never revealed that he was an eyewitness.

Nor did Talese, who wrote that he learned this information from Foos in the 1980s, nearly six years after Foos said the murder took place. He said he questioned Foos further: “I wanted to find out whether he realized that, in addition to witnessing a murder, he might have, in some way, caused it” by disposing of the man’s drugs.

But until his story was published this past week, Talese never disclosed what he knew about Foos’s involvement. “I spent a few sleepless nights, asking myself whether I ought to turn Foos in,” he writes. “But I reasoned that it was too late to save the drug dealer’s girlfriend. Also, since I had kept [Foos’s] secret, I felt worrisomely like a co-conspirator.”

Journalists occasionally witness unsavory or even illegal behavior in the course of their reporting. This information is usually kept confidential until publication by an implied or explicit agreement that the reporter will merely observe and not act as an agent of law enforcement. A number of important stories have been produced under such circumstances; information from sources such as Edward Snowden — who revealed widespread surveillance by the National Security Agency to The Washington Post and Guardian newspapers — would probably have never become public if the source feared that journalists were cooperating with authorities.

But Talese’s story presents a variation on the theme: Does a reporter have any responsibility to protect a source when he knows the source isn’t telling the police all he knows about a serious crime? Does his silence, as Talese himself acknowledged, make him complicit?

In a brief exchange of emails on Thursday, Talese declined to comment directly. He cited a busy schedule and his concerns about being “misunderstood” again after an unrelated controversy erupted recently over remarks he made in a public appearance. “I just wish you’d quote what I wrote in the story the New Yorker published,” he wrote.

But in a separate email exchange, New Yorker editor David Remnick defended Talese. He wrote: “As the piece makes clear, Gay Talese was not a ‘witness’ to the murder. Not ‘in essence,’ and not in fact. Rather, he read an account of the event in Foos’s journal when he received it in the mid-1980s, some six years after entry dated 1977 (and almost 30 years before writing about it for The New Yorker). Also according to the journal, the murder had been reported to the police when the body was discovered, and they had investigated the crime scene, and pursued the leads that Foos had given them (the registration name and license plate number of the car) to no avail.”

He added, “While the scene is certainly disturbing (Talese writes that he was ‘shocked, and surprised’ to read the account in the journal), the New Yorker does not believe that Talese or it violated any legal or ethical boundaries in presenting Foos’s account of it to the reader.”

But Andrew Seaman, chairman of the ethics committee of the Society of Professional Journalists, suggested it was more nuanced than that.

“I think the main lesson for journalists to take away from Talese’s experience is to be careful when making promises,” he said. “I don’t think any journalist should blindly promise to keep information off the record without some negotiation.”

Talese, he said, might have told Foos that he would not keep criminal information secret and could even have renegotiated his confidentiality agreement after making it.

As a legal matter, Seaman said some states compel journalists to come forward when they are aware of a murder, “which is why they should be careful when making promises.”

He added: “There is no universal answer. What is legal is not always ethical, and what is ethical is not always legal.”

The upshot of the motel murder is that it may not even have taken place. In conducting further reporting in 2013, Talese contacted the police department in Foos’s hometown, Aurora, Colo. As he reports in the New Yorker, the department could find no record of such a murder.

Talese doesn’t address the implications of this finding in his article: Did Foos make it all up? If so, how credible is the rest of his account? Neither Talese nor Remnick replied to that question.