
Make common cause with somebody
Shared Goals
Use when individuals or groups work together due to shared objectives, not necessarily lasting friendship. 
Temporary Alliance
The phrase often implies a temporary alliance, not a permanent partnership. 
Mutual Opposition
It's commonly used when groups unite to oppose a mutual threat or enemy. 