Bava Basra2: 11
מַרְחִיקִין אֶת הָאִילָן מִן הַבּוֹר עֶשְׂרִים וְחָמֵשׁ אַמָּה, וּבֶחָרוּב וּבַשִּׁקְמָה — חֲמִשִּׁים אַמָּה, בֵּין מִלְמַעְלָה בֵּין מִן הַצַּד. אִם הַבּוֹר קָדְמָה — קוֹצֵץ וְנוֹתֵן דָּמִים; וְאִם אִילָן קָדַם — לֹא יָקֹץ. סָפֵק זֶה קָדַם וְסָפֵק זֶה קָדַם — לֹא יָקֹץ. רַבִּי יוֹסֵי אוֹמֵר: אַף עַל פִּי שֶׁהַבּוֹר קוֹדֶמֶת לָאִילָן לֹא יָקֹץ, שֶׁזֶּה חוֹפֵר בְּתוֹךְ שֶׁלּוֹ וְזֶה נוֹטֵעַ בְּתוֹךְ שֶׁלּוֹ.
One must distance his tree twenty-five cubits from a pit, and in [the case of] carob or sycamore trees, fifty cubits, whether from above or from the side. If the pit was there first, he cuts [it] down and pays compensation; if the tree was there first, he may not cut [it] down. [If it is] uncertain which was first, he may not cut [it] down. R' Yose says: Even if the pit preceded the tree he may not cut [it] down, because this one digs within his property and that one plants within his property.