The line comes from the Mahā Upaniṣad (6.71–73) and also appears in the Hitopadeśa. In full it says that counting people as 'mine' and 'not mine' marks a small mind, while for the large-hearted the whole earth is one family. It is not from the four Vedic Saṃhitās.
Read sources & contribute → sanatanfacts.online