It’s a tricky question, I kid you not.
I live in a normal subdivision, almost out in the country (that is, there are cows and horses across the street), in suburban Atlanta. My neighborhood is zoned residential – not agricultural.
My neighbor had three goats in the back yard of their house. No big deal from my point of view; they made their maa-ing sound from time to time, but they didn’t stink or anything else.
Anyway, the neighbor on their other side called the County on them, and the goats were picked up by animal control and (not sure what happened to them). The people moved away within a month or two.
So this is a long way of saying that goats in a residentially-zoned area are a definite no-no. Not sure about your theoretical situation, but don’t count on bringing the goat home.