To get in and out alive peacefully you need to treat the game as if it was a boardgame. In a boardgame, five or six people sits around a table and play a game to win. If someone is in the lead, the others usually target, if not all, at least some, of the their power to "hit the leader". So well, try not to be the leader, at least not until you have to. Be the number two. Very few look at who's the runner up.
When it comes to diplomacy, ironically, you can't have any friends, at least not any good ones. So never become friends with anyone. This because if you become friends with civ A then their is a good chance that civ B will start to hate you. Why? just because they hate civ A. However you can't be liked by all. One possibility that I used in one of my recent games was that I kept track of any warmongers and I wound one that was hated (denounced) by half the AIs and neutral with the rest. Most importantly, the AIs that has denounced him was on my continent. So I went on and denounced him. Sure, the particular civ will start to hate you, but he will on the other hand hate a lot of civs due to the fact that a lot of civs have denounced him.
One of the most important factors (also a little bit ironic) is that you need to have a sizeable and
good army and you need to show it. The AI don't like when you have units on his border so this is stupid (and quite irritating, because he likes to be on the border himself) but you can start to allow them to walk around in your lands, but in this case, allow all that wants to. But you need to have a sizeable force for this. Another solution is to put a lot of good forces along the border and then when he ask about them you say sorry and move them. This way you have also showed your army and also been nice and moved them.
They don't like when you settle near them (but for some reason they like to settle near you). In this case I usually (with a good amount of money at hand) settle at sensible areas and buy all the lands that I want and then when he mention this, you are very sorry and promise to never do this again. And well, don't do it again.
Sometimes the AI will beg, usually if you are weak (military) and have a lot. Sometimes it is better to just give them one of your extra luxuries or whatever. But I have noticed that it can also work (without a rep hit) if you decline his begging, but immediately offer them a deal, any deal.
In other civ game, the various AIs can hate and various civs. If you are liked with a civ in for example Civ IV then it doesn't matter much what relation he have with others. There is a points system and there are variables for this, but no significant ones. In CiV it seams (I'm no expert) to affect a lot all the various relations. Just as a boardgame. In other civ games it was built up around you, what you did, will you win or not. In CiV this is not the case.
As others have mentioned, the peaceful game is a myth. Well, sort of. For me I have a peaceful game once or twice per ten games or so. In the other games there are factors that I know will spoil a peaceful building game eventually so I skip that plan before it happens. For example, if Alexander (or other civs that I know is a maniac) is one of my neighbours, or there are only one warmonger on my continent and some other AI that also just build or are "culturing", or I have bad luck with resources on my part of the world (since I can't attack or use aggressive diplomacy to get resources).
Oh, if someone attacks you, don't go for it. Don't think "He attacked me, he is the warmonger, why can't they see that". No they do see that, but they also see another civ grabbing cites and for the AI this is just as bad. Just take out his army and take one city from him. When he offers peace, accept it. If you get cities that you don't like to have or that doesn't add good things to your empire (without having more borders with more civs that can spoil more relationships), give those cities back. Another possibility is to offer peace yourself, perhaps even you giving back a city (or more) that you have taken from him. Don't forget to also include the peace with CS (on both sides). If you think "But those cities, they are my spoils of war", well it costs to be an angel and perhaps this method of play is not for you.
Lastly, in Civ IV it was all about you and if you don't act, there was a good chance that the game stalemated and could be run peaceful, a peace full of tension, but still, peace. In CiV, every AI goes for a win so be prepared to get your peace-loving dreams destroyed. There is a good chance that an AI all of sudden starts to go rampage and someone needs to stop him (this is why I never think "peace" if Alexander is in the game).