A man said, "Messenger of Allah, I have a piece of land in which no one has any partnership or share, only neighboring property."The Messenger of Allah ﷺ said, "The neighbor has the greater right to what is adjacent to him."
أخبرنا إسحق بن إبراهيم قال حدثنا عيسى بن يونس قال حدثنا حسين المعلم عن عمرو بن شعيب
أن رجلا قال يا رسول الله أرضي ليس لأحد فيها شركة ولا قسمة إلا الجوار فقال رسول الله ﷺ الجار أحق بسقبه
Its chain of transmission is sahih. Ibn Majah narrated it in the chapter on preemption, section on preemption by neighborhood, hadith no. 2496, from the hadith of Husayn Muallim, with this wording. It is also found in al-Kubra, hadith no. 6302.