First, BOTH you and the target need to have the alliance tech. If nothing else, sell it to them.
Second, you must have CLOSE relations. This cannot be forced, your relations will jump from friendly to close on a random basis. Get your relations to friendly, then check every turn to see if they have upgraded to close.
To get to friendly, use freighters to trade with them, trade techs with them, outright give them stuff on occasion. I can't stress the importance of having a military, either. Bigger is better.
In the foreign relations window, select the civ you want, then select the report tab. This will give you a window with your current relations and the factors contributing to them. Try to get as many + factors as possible, and eliminate the - factors as much as possible.