As TrongaMonga said, there is a trigger for it.
"Set Alliance Status"
Be sure to set it up for yourself, and your friendly comp to be each others ally, to save accidental killings. Adding a shared vision trigger is a nice tidbit also.
And be sure to set the enemy comps and the friendly comps to enemy, or they won't go after each other.
You don't necessarily have to make a trigger to set the enemy comp as your enemy, that is an automatic given in StarCraft.
The down side to a map like this...
Unlike in a Top and Bottom game, the friendly comp may fight along your side, and not fight you, but he will have no reason to come to your aid if things get bad for you. He has is own agenda, and your health is not it.
I attached an example game I made, before the Top and Bottom setting came out. All of the appropriate triggeres are there to see.