Abu Hurairah reported,

The Messenger of Allah ﷺ said to his uncle as death approached him, "Say, there is no god but Allah, and I will bear witness for you with it on the Day of Resurrection." But he refused, so Allah revealed, "Indeed, you do not guide whom you love" [Qasas 28:56].

Azami 147

Sahih

عن أبي هريرة قال

قال رسول الله ﷺ لعمه عند الموت: قل: لا إله إلا الله، أشهد لك بها يوم القيامة فأبى، فأنزل الله: {إنك لا تهدي من أحببت} [سورة القصص: ٥٦].

الأعظمي 147صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Evidence for the validity of embracing Islam for one who is dying, as long as the death throes have not begun
Numbering
Jami al-Kamil 147 (2nd edition)
Azami 147