Did not see the episode, but my take is that they’re wrong on the law. There are exceptions to the hearsay rule that probably would apply to the other man’s statements.
A statement that would tend to subject the speaker to criminal liability (like confessing to a crime) is generally admissible if the speaker is unavailable (e.g., dead). We trust the reliability of such a statement because we think it’s relatively unlikely that a person would falsely implicate himself in a crime.
If this were a homicide case, and if the other man had made his confession while actually on his deathbed, the statement could be admitted as a dying declaration. The reliability of his statment in this instance arises from an assumption that someone who thinks he is leaving this world will have less inclination to lie.
I’m working from the federal rules of evidence in setting forth the above answers. NY state rules of court may be slightly different, but the same general principles should be there.