Say I used to live in City A and moved to B now. City A is the last city I lived in.
But if I lived in City A, then moved to City B, then to City C, then finally to City D. What should I call City A for?
I suppose you could say:
It's the city I lived in three cities ago.
It's a bit clumsy, but I can't think of a better alternative. It's also informal.
Most of the time we wouldn't express this concept directly, instead saying something like:
That's where I lived six years ago. I've moved a few times since then.
If I wanted to be specific, I might say something like:
I've moved three times since I lived in City A.
Of course, you can come up with variations on these themes.
Unfortunately, unless City A was the first city you lived in, you'll need to settle for cardinals:
You can keep going, too... first/second/third/fourth/fifth/etc last, but it become clumsy when you get too far away. If it's important that the person you speak to knows exactly how many cities ago it was, you don't have much of a choice, but otherwise, it might be easier to say that you lived in the city X years ago.
There is the word 'preantepenultimate' though it's quite rare and most people probably won't know what you mean if you use it.
Last in a series: ultimate
Second-last: penultimate (common)
Third-last: antepenultimate (not common)
Fourth-last: preantepenultimate (very uncommon)
In order to expand the variety, I'll give it a try, but bear with me, I'm not a native speaker:
City A is the city that I lived in before the two other cities that preceded the current one.
City A is the city thrice removed from the current one in the succession of the cities I've lived in.
City A is the fourth-latest city I've lived in.
Option 1 is a mouthful to pronounce. Option 2 could be erroneous, since the expression is usually used in describing family relations (such as cousin twice removed). Option 3 is the shortest one but looks a bit unusual, as jimsug wrote.