Reach Ally Status with a City-State.
To become an ally with a city-state, you must have more than 60 influence with them, and have more influence than any other civilization. Influence can be earned by giving gold and units, and also by performing quests.
In the Base Game, the easiest way to make an alliance with a city-state is with large amounts of gold. In Gods and Kings, you will be offered many tasks that help you ally with states without gold. You can also use a spy to perform a coup and replace their current ally.
"Say hello to my little friend" is a famous line from the movie Scarface.