Personally I try to avoid pacts. But when I am about to become extinct I suppose I wouldn't say no if an offer does come by.
The best idea I can give you is to be the first who offers the truce, I suppose you were referring to a a situation where you become stronger than the others and when they see you as a possible threat they just do the right thing by attacking you in fear of losing the game. If you are quick and see that you are about to become powerful, just offer a truce to your closest opponent who will be more than happy to avoid confrontation with the strongest player. Thus giving you more time and resources to deal with the other opponents and leaving your ally last.
Another suggestion I can throw from the top of head is to be as subtle as possible, avoid any confrontations throughout the game by holding just a small number of countries that have large numbers of armies: this way your opponents will be more reluctant to attack countries that have big numbers on them. You just sit there in low profile until your opponents finish of each other and head for the kill at the right moment.
Of course these are just my tactics and you can deem them useless if you may
