I don't know much about legal matters other than what I pick up through incidental reading. What makes a confession valid vs being considered hearsay? Multiple witnesses? A signed affidavit? Courtroom testimony or a deposition?

Evidence Rule 804 makes an exception for: "Statement Under the Belief of Imminent Death. In a prosecution for homicide or in a civil case, a statement that the declarant, while believing the declarant’s death to be imminent, made about its cause or circumstances."

Not that I have ever or would ever murder someone, but if I were in that situation, my defense would probably be either:

1) heart-attack (or heart attack drug) induced delirium

or

2) I became very familiar with the case due to the false accusation, and felt great empathy for the family. I'm an atheist, and believe once you're gone, you're gone. So I thought a harmless lie that can't hurt me might help her family find some peace...