It was narrated from Abu Salamah bin 'Abdur-Rahman and Abu 'Abdullah Al-Agharr, the freed slave of the Juhanis - better of whom were companions of Abu Hurairah - that they heard Abu Hurairah say: "One prayer in the Masjid of the Messenger of Allah (ﷺ) is better than one thousand prayers offered in other mosques, except Al-Masjid Al-Haram, for the Messenger of Allah (ﷺ) was the last of the prophets and his Masjid was the last of the Masjids." Abu Salamah and Abu 'Abdullah said: "We do not doubt that Abu Hurairah was speaking on the basis of the Hadith of the Messenger of Allah (ﷺ), but we could not verify that Hadith with Abu Hurairah before he died. Then we remembered that and we blamed one another for not having spoken to Abu Hurairah about that, so that he could attribute it to the Messenger of Allah (ﷺ) if he had indeed heard it from him. While we were arguing, we went and sat down with 'Abdullah bin Ibrahim bin Qariz, and we told him about the Hadith and how we had been negligent in not checking it with Abu Hurairah. 'Abdullah bin Ibrahim said to us: 'I bear witness that I heard Abu Hurairah say: The Messenger of Allah (ﷺ) said: I am the last of the prophets and it is the last of the Masjids.'"
Sunan an-Nasa'i 694
Chapters
1 The Book of Purification 2 The Book of Water 3 The Book of Menstruation and Istihadah 4 The Book of Ghusl and Tayammum 5 The Book of Salah 6 The Book of the Times (of Prayer) 7 The Book of the Adhan (The Call to Prayer) 8 The Book of the Masjids 9 The Book of the Qiblah 10 The Book of Leading the Prayer (Al-Imamah) 11 The Book of the Commencement of the Prayer 12 The Book of The At-Tatbiq (Clasping One's Hands Together) 13 The Book of Forgetfulness (In Prayer) 14 The Book of Jumu'ah (Friday Prayer) 15 The Book of Shortening the Prayer When Traveling 16 The Book of Eclipses 17 The Book of Praying for Rain (Al-Istisqa') 18 The Book of the Fear Prayer 19 The Book of the Prayer for the Two 'Eids 20 The Book of Qiyam Al-Lail (The Night Prayer) and Voluntary Prayers During the Day 21 The Book of Funerals 22 The Book of Fasting 23 The Book of Zakah 24 The Book of Hajj 25 The Book of Jihad 26 The Book of Marriage 27 The Book of Divorce 28 The Book of Horses, Races and Shooting 29 The Book of Endowments 30 The Book of Wills 31 The Book of Presents 32 The Book of Gifts 33 The Book of ar-Ruqba 34 The Book of 'Umra 35 The Book of Oaths and Vows 36 The Book of the Kind Treatment of Women 37 The Book of Fighting [The Prohibition of Bloodshed] 38 The Book of Distribution of Al-Fay' 39 The Book of al-Bay'ah 40 The Book of al-'Aqiqah 41 The Book of al-Fara' and al-'Atirah 42 The Book of Hunting and Slaughtering 43 The Book of ad-Dahaya (Sacrifices) 44 The Book of Financial Transactions 45 The Book of Oaths (qasamah), Retaliation and Blood Money 46 The Book of Cutting off the Hand of the Thief 47 The Book Of Faith and its Signs 48 The Book of Adornment 49 The Book of the Etiquette of Judges 50 The Book of Seeking Refuge with Allah 51 The Book of Drinks