There’s a great article addressing this very scenario (which is typically called the Violinist argument, first propograted by Judith Jarvis Thompson). You can read “Stand to Reason: Unstringing the Violinist” here: str.org/site/News2?page=NewsArticle&id=5689
Here is some of it in brief, but I highly encourage you reading the whole thing:
"Are there important differences between pregnancy and kidnapping? Yes, many.
First, the violinist is artificially attached to the woman. A mother’s unborn baby, however, is not surgically connected, nor was it ever “attached” to her. Instead, the baby is being produced by the mother’s own body by the natural process of reproduction.
Both Thompson and McDonagh treat the child—the woman’s own daughter or son–like an invading stranger intent on doing harm. They make the mother/child union into a host/predator relationship.
A child is not an invader, though, a parasite living off his mother. A mother’s womb is the baby’s natural environment. Eileen McDonagh wants us to believe that the child growing inside of a woman is trespassing. One trespasses when he’s not in his rightful place, but a baby developing in the womb belongs there.
Thompson ignores a second important distinction. In the violinist illustration, the woman might be justified withholding life-giving treatment from the musician under these circumstances. Abortion, though, is not merely withholding treatment. It is actively taking another human being’s life through poisoning or dismemberment. A more accurate parallel with abortion would be to crush the violinist or cut him into pieces before unplugging him.
Third, the violinist illustration is not parallel to pregnancy because it equates a stranger/stranger relationship with a mother/child relationship. This is a key point and brings into focus the most dangerous presumption of the violinist illustration, also echoed in McDonagh’s thesis. Both presume it is unreasonable to expect a mother to have any obligations towards her own child."