proverb

Adversity makes strange bedfellows.

Theme: cooperation Keyword: friend

means that

people who would not normally associate with one another may become allies when they face a common difficulty.

also

Politics makes strange bedfellows.

Example

Two rival shopkeepers worked together to protect their street from flooding. Adversity makes strange bedfellows.