Mishkat al-Masabih 723
عَنْ أَبِي سَعِيدٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: إِذَا رَأَيْتُمُ الرَّجُلَ يَتَعَاهَدُ الْمَسْجِد فَاشْهَدُوا لَهُ بِالْإِيمَان فَإِن الله تَعَالَى يَقُولُ (إِنَّمَا يَعْمُرُ مَسَاجِدَ اللَّهِ مَنْ آمَنَ بِاللَّه وَالْيَوْم الآخر وَأقَام الصَّلَاة وَآتى الزَّكَاة) رَوَاهُ التِّرْمِذِيّ وَابْن مَاجَه والدارمي
From Abu Saʿid, who said: The Messenger of Allah ﷺ said: "When you see a man frequenting the mosque, bear witness to his faith, for Allah the Exalted says: 'Only he maintains the mosques of Allah who believes in Allah and the Last Day, establishes the prayer and gives zakah.'" Reported by at-Tirmidhi, Ibn Majah and ad-Darimi.