`Ali bin Abi Talhah narrated from Ibn `Abbas, about,
﴿إِنَّ الَّذِينَ ءَامَنُواْ وَالَّذِينَ هَادُواْ وَالنَّصَـرَى وَالصَّـبِئِينَ مَنْ ءَامَنَ بِاللَّهِ وَالْيَوْمِ الاٌّخِرِ﴾
(Verily, those who believe and those who are Jews and Christians, and Sabians, whoever believes in Allah and the Last Day) that Allah revealed the following Ayah afterwards,
﴿وَمَن يَبْتَغِ غَيْرَ الإِسْلَـمِ دِينًا فَلَن يُقْبَلَ مِنْهُ وَهُوَ فِى الاٌّخِرَةِ مِنَ الْخَـسِرِينَ ﴾
(And whoever seeks religion other than Islam, it will never be accepted of him, and in the Hereafter he will be one of the losers) (3:85).
This statement by Ibn `Abbas indicates that Allah does not accept any deed or work from anyone, unless it conforms to the Law of Muhammad that is, after Allah sent Muhammad . Before that, every person who followed the guidance of his own Prophet was on the correct path, following the correct guidance and was saved.