It was narrated from Usamah bin Zaid, who attributed it to the Prophet ﷺ:
“The Muslim does not inherit from a disbeliever and the disbeliever does not inherit from a Muslim.”
حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، وَمُحَمَّدُ بْنُ الصَّبَّاحِ، قَالاَ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنِ الزُّهْرِيِّ، عَنْ عَلِيِّ بْنِ الْحُسَيْنِ، عَنْ عَمْرِو بْنِ عُثْمَانَ، عَنْ أُسَامَةَ بْنِ زَيْدٍ، رَفَعَهُ إِلَى النَّبِيِّ ﷺ قَالَ " لاَ يَرِثُ الْمُسْلِمُ الْكَافِرَ وَلاَ الْكَافِرُ الْمُسْلِمَ " .