It depends.
I had a patient who would have had an abortion if the baby's father was one guy vs. another guy. An amnio would have established paternity, and yes, people will perform an amnio for this reason. She paid for it out of pocket to prove paternity before carrying the baby to term. She was about 14 weeks. "Five months" is not very specific and might depend on your states' laws re: when an abortion could occur. You could play with the gestational age to make it more plausible. An amnio can be done at any stage of the pregnancy, but it comes down to why are you doing it and what would you do with the information.
For your story, could a woman be bullied into giving consent and could there be a sleazy doc who would do it? I would say yes. There are people who would do an amnio to check for paternity. It would be a challenge, but it would not be impossible. If a 41 year old wants to have an amnio in her mid-trimester to check for Downs, that would be very realistic and they could compare it to potential FOB's (father-of-baby) to establish paternity.
Edited to add: you could have a blood type incompatibility as well. Say her antibody screen comes back showing her body has learned to (potentially) attack the baby's red blood cells. You could do a cordocentesis and get dna that way, although that is messing with some serious stuff and she would need to be in the loop with some perinatologists. An amnio would be simpler. Also, there are some newer studies finding fetal cells in maternal circulation. If this is set in the near future (2008 possibly) one could isolate fetal cells from a maternal blood draw. That is cutting edge (where I live anyway). Sorry for the rambling. There have been many babies in my life recently and very little sleep.