Since the 1600s, the verb 'to wet' has meant to celebrate by drinking, though the earliest use of 'wet the baby's head' as such dates only to the 19th century. When a baby is baptised, its head is literally 'wetted' by the priest, so the custom of fathers inviting friends to 'wet the baby's head' is just a sort of secular baptism, as it were.