Parashas Naso
וְהִתְוַדּ֗וּ אֶֽת־חַטָּאתָם֮ אֲשֶׁ֣ר עָשׂוּ֒ וְהֵשִׁ֤יב אֶת־אֲשָׁמוֹ֙ בְּרֹאשׁ֔וֹ וַחֲמִישִׁת֖וֹ יֹסֵ֣ף עָלָ֑יו וְנָתַ֕ן לַאֲשֶׁ֖ר אָשַׁ֥ם לֽוֹ׃
they shall confess the wrong that they have done. They shall make restitution in the principal amount and add one-fifth to it, giving it to the one who was wronged.
Torah Temimah points to R’ Nasan — TT (verified).
והתודו את חטאתם — תניא, ר׳ נתן אומר: והתודו את חטאתם אשר עשו — זה בנה אב לכל המתים שטעונין וידוי.
English: “And they shall confess their sin” — it was taught: R’ Nasan says: This builds a prototype for all who are dying, that they require confession.
Custom
Chazal establish from this verse that one who is dying must make confession.