I think you're hiding 2 questions here: when should you use nukes, and how should you use nukes. But first, I think this question beckons a little more explanation of how to win a game, especially since you mention both nukes and the United Nations.
How to win a Civ 5 game?
There are multiple ways to obtain a victory in Civ 5.
- If all civilizations but one have lost control of their capital, that civilization wins.
- If a single civilization gets a majority vote in the UN, that civilization wins.
- If a civilization succeeds in building the Utopia project, that civilization wins.
- If a civilization succeeds in launching a spaceship, that civilization wins.
- If none of the above happened by the year 2050 (turn 500 in a regular-speed game), the civilization with the highest score wins.
This is not the place to get into details on all the above conditions, there's the manual and other sources for learning about that - but the key is, if it's already late game (and it is if the United Nations is in play), you should already have a strategy in mind.
If you still don't have a strategy for winning then stop, review the above conditions, and decide which one is best for you. The United Nations is already in play, meaning that if one of the civilizations managed to obtain a majority in the vote, the game is over - though the only way to do that, when there are just two civs, is to bribe all the city-states to vote for you. On the other hand, if there's only one other civ in play, a blitz action to conquer its capital is likely to succeed, especially when you're sitting on a stockpile of nukes.
How to use nukes?
In my eyes, nukes can serve two different roles - as a strategic weapon to weaken the enemy's economy, or as a tactical weapon to destroy units and weaken cities before conquering them.
As a strategic weapon, cities getting nuked will lose half their population and some of their non-wonder buildings, and many improvements around them will be destroyed; recovering from that can take a lot of turns. One nuke won't make a lot of difference, but if you have a bunch of them, and you have quality enemy cities in range, you can put a serious dent in your opponent's economy.
If you intend to use nukes as a strategic weapon, I recommend spreading the nukes around (1 or 2 per city), because you want to get the most out of the improvement-destroying and the fallout.
As a tactical weapon, nukes can cause damage to cities, making them easier to capture; but where they truly shine is the damage they inflict to units. A nuke will severely damage all units in range 2, possibly killing them, and this can be a great way to break enemy formations and fortifications. Nukes are also useful for killing units hiding inside cities, especially missiles and planes.
If you intend to use nukes as a tactical weapon, just target clumps of enemy units. Try to force them together - for instance, by creating a threat at a certain location. Don't waste a nuke on a single unit unless you have to. Also be careful when using nukes on the defense, nuking your own territory sucks. Nuking cities should be probably reserved for cities with a powerful garrison and missiles / planes.
When should you use nukes?
If there are just 2 civilizations left, I'm guessing your relation with the remaining one is pretty sour anyway. If you want to achieve victory in any way which isn't by conquering their capital, use the strategic nuking approach. If you want to conquer their capital, save the nukes for the tactical approach. If you are militarily inferior to your opponents you can also save the nuke for defense, but remember to target clumps and avoid targeting your own territory, you will probably need to actively patrol around your continent to find the enemy flotilla before it gets to you.