First and foremost, you need to become aware of your own preferences and requirements. Knowing that "both would be a good fit" is nice, but it isn't enough. You'll need to know what your preferred option is, and how much better the offer from the other institution needs to be to change your mind. As long as you don't have a pretty good idea about this, I am unsure what you are even negotiating for. This should also be informed by your initial offers. Don't forget that offers are not just salary, but also (and maybe more importantly) also include a startup package.
From then on, I suggest playing with open cards. Go to your second option and tell them that, while their place is great, you have an offer that you would prefer more. It probably does not hurt to tell them specifically which other offer you have, and why you prefer it (especially if the reason is something that can potentially be fixed, e.g., a better package). See if they make any motion to improve their offer. If they don't, go to your preferred option. If they improve their offer and it subsequently becomes preferable, you can also talk to the other offer to check whether they also agree to an upgrade of their offer.
After that, I would probably stop. One round of negotiation should not annoy anybody, but going back and forth between offers too much may leave a sour taste in the mouth of your future employer, and it seems unlikely that you will be able to increase your offer much more after the first round of negotiation anyway (at least that's what I have been told).
Some things to do:
- Keep it professional. Negotiating your salary / package isn't dirty, but make sure that you are not getting greedy and/or ridiculous in your demands.
- Don't let yourself be fooled by non-arguments. If, for instance, one institution justifies their weaker offer with internal arguments ("You would be making more than some Associate Professors here!"), you should be aware that this may or may not be true, but it is entirely irrelevant for your decision process. A weak offer does not magically get better for you because an institution cannot offer more for whatever reason.
- For similar reasons, try to keep discussions on an objective level as far as possible. As soon as somebody starts to argue based on fuzzy factors ("Ok, we don't pay as much, but the research environment here is much better than over there."), negotiations tend to take a turn towards the personal. That is not to say that you should not take these factors into account (you most definitely should), but your actual negotiation arguments should be based on objective data (salary, package, travel grants, tenure conditions, etc.).
- Never try to use an objectively worse offer to improve the already superior offer. That is, just having another offer is not enough to negotiate, you also need to be able to tell the people you are negotiating with (with a straight face) that the other offer is actually better for you. If you have one offer for 80.000 USD and one for 75.000 USD, the fact that you have another weaker offer helps you not at all to negotiate the 80.000 USD.