I'm in a game where Catherine's empire has grown to enormous proportions and started to attack city-states. When she attacked Dublin, which I was befriended with and which I depended on for food at the time, Dublin "requested my assistance." This was a good opportunity to declare war, which I was already preparing for. So I wiped out Catherine's units in and around Dublin. I have not received any thanks for it though, on the contrary, I was accused of trespassing in Dublin and the friendship ended rather soon.
I also remember supporting a city-state with unit gifts in a different game, which had zero effect as well.
What should I do to aid city-states in a war against other civilizations? Do I have to wipe out the entire opposing empire before my help is acknowledged?