Or you could go on a systematic slaughter of all male/female dwarves except possibly one, to allow babies to replace the ones killed.
Yes, there is real-life examples. Hornets, for example, do it all the time to males whose sole purpose is not to reproduce. This would also be a fairly more in-tune with life example as I don't think I know of many animals who segregate their communities. And before someone lambasts me for this, this is a topic calling for the segregation of men and women for fun. What I'm doing is only slightly more morally depraved than that, ha!
However, given your idea I think it would be far simpler to assign all your females to masonry and all your males to something such as crafting stone objects (except one). When the time comes, make the one who isn't assigned to a job build a wall between the two areas and have them function as two different fortresses. This, of course, is only for temporary ideas on how to get them separate in the first place.
You could, in the meantime, have a literal wall that separates the sides, with a section of locked/forbidden doors that deny access inside or over them. While this wouldn't be a perfect plan, this is once again only for the beginning stages of segregation.
Once again, for a more real-life example discounting xenophobic six-year-olds then I'd point you to the first example, if you so saw you dwarves as little bugs to squash to your liking.