In our company, when one of the colleagues (or a spouse of a colleague) gives a birth to a child, others are typically gathering money for a present for a new-born child and a birthday card. The contribution is small (up to $5). This is organized by a secretary.
On the particular case, the colleague who is about to receive such a present is not well-known to me personally. She has intentionally and professionally kept her colleagues out of her private life and at a distance. I know nothing about her except her name, how she looks (yes, we physically work on the same floor), her working area, and the name of the child. She hasn't even communicated the name of the father. I don't mind that at all - such a distance is ok with me as long as this distance is also maintained in all areas consistently. In effect, there is nothing personal.
Moreover, several months before the birth, while still working, she declined my help request on a project issue, despite being reservedly helpful earlier. Servicing the particular request would have cost her 5-10 minutes. To do the job, I needed to invest several hours, since I had no background in the issue, and she knew that. That was hard to take (and, due to the amount of time spent and a suboptimal result affecting my work till now, I do remember that very well), but, formally speaking, she had a right to decline the request. I have no right whatsoever to reproach her. However, declining this request alienated us even further.
Finally, my contract with the company terminates in a few months anyway, before she returns from her parental leave, and then I'm on the job market without funding; so I'm in an expense-calculation mode now. Of course, some savings exist, but they have all been allocated for the purposes of my family. E.g., I take food from home instead of going to the canteen. Moreover, I'm earning less than my colleagues, working half-time now. (The secretary, the boss, and 1-2 people more know my half-time status, but not more.)
How to decline contributing to a gift politely?
Yes, I've read How can I politely decline collecting donations for birthday presents? (The two situtations are partially overlapping but different. E.g., the current situation is very concrete and may be gender-specific in addition. Moreover, the birth of a child happens much more rarely than a birthday celebration.)