While not exactly an alliance in the classic sense of the word, there is a certain amount of cooperation in the Arkhamverse, especially in City and Knight.
Note: spoilers for the Arkham City and Arkham Knight video games follow.
Arkham City, Batman is forced to help Joker find a cure for his illness after being infected with his blood. Batman finds a cure together with Mr Freeze, and administers it to himself, but before he can cure Joker, Joker ambushes him, accidentally destroying the only cure that can heal him. Joker dies shortly afterwards.
In Arkham Knight, it is revealed that Joker's blood turned the infected people insane, Joker style. 4 people were infected, along with Batman. 3 of the normal people infected turned into Joker copycats soon after infection. The 4th infection took hold during the events of Arkham Knight. Early during the events of Arkham Knight, Batman inhales a large dose of Scarecrow's toxin, forcing the Joker Personality to emerge.
The Joker Personality is present throughout the rest of the main storline. providing comments on the situation in Joker's classic sarcastic tone. During 2 segments of the storyline, the Joker takes control over Batman. The first time, it is unintentional, after Scarecrow sprays additional toxin in Batman's face onboard the Stagg zeppelin. The second time could be seen as intentional: Batman has been forced to surrender to Scarecrow to save his friends, and Scarecrow injects him with toxin. Unbeknownst to Scarecrow, Joker was waiting for this moment to take over Batman. Scarecrow thus was surprised when Batman said he was not afraid, and injected him again. This then made Joker become afraid of being forgotten and allowed Batman to take control again.
Neither of these are alliances in the classic sense of the word, but especially the events of City sound like what you are looking for: a common goal in saving both of their lives. Arkham Knight is a bit more tenuous, but it could be argued that they both had the common goal of saving Gotham from Scarecrow, although Joker had the goal on top of that of gaining control over Batman.