The Battle of Ain Jalut was an interesting case of this. Here, a Mongol force attempted to invade Egypt through the Levant. While the Mamluks, the ruling force of Egypt at the time, were engaged in a religious conflict against Christian crusaders in Jerusalem, the Crusaders allowed the Mamluks to move through and resupply in their territory against the Mongols. This may have contributed to the decisive defeat of the Mongolian forces at Ain Jalut.
As a general rule, I think it's usually the opposite. I'm speaking more about the divide and conquer strategies most European colonies had going on.