The Messenger of Allah ﷺ said, "The neighbor of a house has the greatest right to it."
حدثنا علي بن حجر حدثنا إسمعيل ابن علية عن سعيد عن قتادة عن الحسن
قال رسول الله ﷺ جار الدار أحق بالدار
[Its isnad is hasan]. Abu Dawud also narrated it in "the Book of Business Transactions, Chapter on Pre-emption," no. 3518, and Ibn Majah, no. 2494, from the hadith of Abdul-Malik through the same route.