It doesn't quite work that way. You don't have to fight in any war they declare. However, if/when someone attacks them in their territory, then you're dragged into it. The same works in reverse as well. So if you have a MPP with Babylon, and they start a war with Germany, but Germany never attacks the Babs in their territory, you won't be dragged into the war. Conversely, if you have a MPP with the Babs, and you and Germany go to war, the Babs won't be drawn into it until Germany (Or another civ) attacks you in your territory.
It should be noted that a unit ending it's turn inside your territory (Or the babs, for that matter) is considered an attack.