Here are some options, depending on the context:
For the drink itself:
* Un dernier verre (a last glass)
* Un digestif (a digestive) - This implies a drink specifically meant to aid digestion.
* Un petit quelque chose (a little something) - This is a more informal way of saying a drink.
For the action of having a nightcap:
* Prendre un dernier verre avant de se coucher (to have a last glass before going to bed)
* Se faire un petit quelque chose avant de dormir (to have a little something before sleeping)
For the item of clothing:
* Une toque de nuit (a nightcap)
Choose the phrase that best fits the context and your desired level of formality.