Islam is a condition of acceptance of good deeds
Having a good belief is a condition for the acceptance of good works. So without the good belief of Islam, there is no reward in the hereafter.
Allâh Ta`âlâ said:
﴿ مَثَلُ الّذِينَ كَفَرُواْ بِرَبِّهِمْ أَعْمَالُهُمْ كَرَمَادٍ اشْتَدّتْ بِهِ الرِّيحُ فِي يَوْمٍ عَاصِفٍ ﴾
(mathalu l-ladhîna kafarû birabbihim 'a`mâluhum karamâdin ichtaddat bihi r-rîHu fî yawmin `âSif)
which means: « The works of those who disbelieved, are like ashes carried away by the wind, a stormy day », [surat Ibrâhîm / 'âyah 18].
The Prophet Muḥammad Salla l-Lâhu `alayhi wa sallam said:
« وَأَمَّا الْكَافِرُ فَيُطْعَمُ بِحَسَنَاتِهِ فِي الدُّنْيَا حَتَّى إِذَا أَفْضَى إِلَى الْآخِرَةِ لَمْ يَكُنْ لَهُ حَسَنَةٌ يُعْطَى بِهَا خَيْرًا »
(wa 'amma l-kâfiru fayuT`amu biHasanâtihi fi d-dunyâ Hattâ 'idhâ 'afDâ 'ila l-'âkhirah lam yakun lahu Hasanatun yu`Tâ bihâ khayrâ)
which means: « As for the unbeliever he will be rewarded for his good works in this life, but in the hereafter he will have no reward », narrated by imam AHmad.
The Imam Abu Hanîfah, may God bless him, said: « There is no faith for a person without Islam nor Islam for a person without faith, they are linked to each other as are the face and the reverse of the same thing »
See: Islam is the religion of all the Prophets. Unique True Religion
https://www.islam.ms/en/?p=106