Notice it says ^a^ and ^the^ stranger - 1 stranger.
An invasion is a different matter.
Invasions can be physically violent or culturally violent or both.
How we treat people 1 on 1 is different than how we treat them as an invading force (see all wars).
It was not possible for a stranger to own land in Israel as it was divied up and required to remain owned by the original family regardless of any temporary transactions that took place.
In the year of jubilee everything reverted back to the original owners.
All of Christ^s teachings were regarding interpersonal relations - not national and not political relations.