The Prophet ﷺ said, "The neighbor of a house has greater right to it than anyone else."
حدثنا عفان حدثنا همام أخبرنا قتادة عن عمرو بن شعيب
أن النبي ﷺ قال جار الدار أحق بالدار من غيره
Its isnad is sahih, its narrators are well known. The hadith was narrated by Bukhari 3/115, in the chapter on shufah, offering the shufah, Abu Dawud 3/86, no. 3516, Tirmidhi 3/241, no. 1368, who said, hasan sahih, and Nasai 7/230, no. 4702.