There are a number of ways to answer this extremely difficult question. First, the Church will never say it is OK to “aim at the death” of either your wife our your prenatal child — both are always going to be wrong. Life is of irreducible value and it is never acceptable to choose that an innocent person should die in order to bring about some other thing — even the very good thing of saving the life of someone else. This is the “Peaceable Kingdom” of non-violence into which Jesus calls all of his followers.
However, there may be times where one can choose to save one person while also “foreseeing but not intending” that one will therefore not be able to save someone else. This may be the situation you describe in this question. You are not directly aiming at the death of either one or the other person, but choosing to save one rather than the other. The Church largely leaves this situation and reasoning up to you, the agent, as long as you have a serious reason (one that rises to the level of life and death) for making your decision. Perhaps it is unlikely that one of the two will survive anyway? Perhaps there are other children in the family to consider? Perhaps you know (or can reasonably guess) the wishes of your wife and what she would want you to do? These and similarly serious reasons would all be acceptable ones (again) as long as you were never aiming at the death of one or the other person.