Jami` at-Tirmidhi 2617
جامع الترمذي#2617Hasanحَدَّثَنَا ابْنُ أَبِي عُمَرَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، عَنْ عَمْرِو بْنِ الْحَارِثِ، عَنْ دَرَّاجٍ أَبِي السَّمْحِ، عَنْ أَبِي الْهَيْثَمِ، عَنْ أَبِي سَعِيدٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِذَا رَأَيْتُمُ الرَّجُلَ يَتَعَاهَدُ الْمَسْجِدَ فَاشْهَدُوا لَهُ بِالإِيمَانِ فَإِنَّ اللَّهَ تَعَالَى يَقُولُ: (إِنَّمَا يَعْمُرُ مَسَاجِدَ اللَّهِ مَنْ آمَنَ بِاللَّهِ وَالْيَوْمِ الآخِرِ وَأَقَامَ الصَّلاَةَ وَآتَى الزَّكَاةَ ) " . الآيَةَ . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ غَرِيبٌ حَسَنٌ .
Narrated Abu Sa'eed:that the Messenger of Allah (ﷺ) said: "If you see a man who comes to the Masjid then bear witness to his faith." Because Allah, the Exalted, says: Only those who believe in Allah, and the Last Day, and establish the Salat, and give the Zakat (should) maintain the Masajid until the end of the Ayah (9:)
Scholarly Authentication
The label above is the grade most of these scholars gave — one dissenting opinion no longer speaks for all of them. If any scholar calls a narration fabricated, that verdict is shown instead, whatever the others say. Each scholar's own wording:
In-book reference: 40:12