A gift is never required, for any sort of announcement.
If the announcement is from a friend or relative you're at all in touch with, a note of some sort--card, letter, email--congratulating the new parent and maybe asking about coming to meet the baby is nice. (I wouldn't pick up the phone, for risk of waking the parents.)
A card like that is never inappropriate: even if you're looking at the announcement and thinking "Mary Smith....do I know a Mary Smith?" they're not likely to be upset at a simple "Congratulations." But if you can't figure out who the person is, it's probably safe to ignore the announcement, unless you have a relative or friend who is good at keeping track of these things and can ask them, in case it's "Oh, you might not remember, your cousin Melisande got tired of nobody being able to spell her name, so she changed it." (I was startled the first time someone referred to my cousin "Sarah," who had been "Sharon" all the time I was growing up.)