90% of the time, the "stop settling cities near us" request is triggered by settling a city that is closer to their capitol than yours. Assuming the map is standard sized and that the two of you are neighbours of course. So i usually count tiles before settling a city, in a largely futile attempt to avoid aggression. Obviously, if you are separated by more than a certain number of tiles, it won't matter, but i'd be very rare to enounter that on standard pangea with default conditions.
Eg. you settle a city 11 tiles from their capitol and 13 tiles from your own, i guess that's not going to trigger them even though your new city is closer to them than it is to you. However i don't know what the exact number of tiles this is before it stops mattering.
The previous post may be talking about the "Covet lands you already own" diplo modifier. This one's truly a bind, because you often get this through no fault of your own. You can settle in the opposite direction from your neighbour, but he plonks a city down right next to you. This coveting modifier kicks once fewer than 7 tiles separate one of your cities from one of their cities, but doesn't differentiate who forward settled whom. Of course, it can also, as the last poster pointed out, occur even if you don't (yet) share any kind of border if you're dealing with an aggressive civ, as soon as he sees your Cap, he thinks "now that's a fine place to put a city, if only i could raze the one that's already there and build my own".
Watch out when you see the "covet lands" modifier, or if the AI starts settling his cities towards your capitol. Unless you're dealing with one of the less aggressive civs, you WILL BE attacked at some point in the next 50 turns. Or the next 5 turns. Especially watch out if the civ you are worried about has his unique unit. For example, Rome gets their UU in the Classical era, so are much more aggressive then, though TBH they're backstabby and aggressive period. Even Ethiopia, normally quite peaceful, can turn when they get their unique unit (mehal sefari, industrial era?) . As i discovered once, my peaceful friend and neighbour since 4000bc actually wanted all my cities