Yep, that's a vanilla thing. If your ally allies to your enemy, you will have peace with your enemy. I remember one time it happened to me on the 11th turn of a 12 turn seige.