When you declare a war of liberation how do you know what cities you can liberate? I'm not even sure which friend/ally they attacked or which city they took...
So for starters, declaring a liberation war is a Casus Belli which means you just have a reason to declare a war, you don't have to actually liberate cities in the war. The bonus you get is that you won't receive warmonger penalties for liberating cities. So you can capture/raze other cities, you'll just get the normal penalties.
As for understanding what cities you can liberate, there's no active list you can find in the game. You can look at their city names however and look for two things: City names that belong to other Civs (this may require Google if you don't know them), and City State names. Those are the two types of places you can liberate.
City States are a set list of names and you can easily determine if a city state is under control of someone else. As for city names of other Civs, it's just a guess and check. Sometimes they are very obvious, such as America (New York) being under control of China and still being named New York.
In addition to n_palum's answer, you don't need to worry about capturing the "wrong" cities in a liberation war. When you occupy (not liberate) an enemy city, keep it. At the end of the war, return it to the enemy and the warmonger penalty from it is refunded.
You may even get away with keeping a few captured cites because liberating cities for other Civs and City States reduces your warmonger penalty.