Wiktionary
the enemy of your enemy is your friend
phr. Two party who have an enemy in common should join forces against it.