Keep the distance out of it. At home-garden scale the useful split isn't between crops that cross a little and crops that cross a lot. It's between crops whose flowers have already pollinated themselves before they open, crops that need an insect to move pollen and can therefore be physically shut out, and the one crop that travels on the wind and can only be handled with timing. Tomatoes, beans, peas, and lettuce need no isolation on a balcony at all. Peppers sit in the awkward middle: mostly self-fertile, but willing to take outside pollen whenever bumblebees are working the flowers. Squash, cucumber, and the brassicas need a barrier rather than a buffer, meaning cages, blossom bags, and your hand standing in for the bee. Corn is where a home grower usually loses, because nothing you can drape over a plant stops pollen arriving on a gust. The quarter-mile numbers in seed-saving books are field numbers. At five feet, you replace distance with cloth.
I was on my knees on a third-floor balcony one July morning doing exactly that, with a sandwich bag of organza pouches, a Sharpie, and a roll of masking tape going soft in the heat. The air smelled like tomato leaf and hot terracotta. A bumblebee was working the pepper pots in a systematic way, flower to flower, and that's what had me out there at seven instead of drinking coffee.
The peppers were the reason. Everything says peppers self-pollinate, and they do; the anthers curl around the stigma and dust it. But the flowers open early, and a bee that has already been inside someone else's jalapeno will land on a fresh flower while the stigma is still receptive. I'd grown a mild Anaheim and a hot cherry pepper in the same cluster the year before, saved seed from both because I thought peppers were like tomatoes, and ended up with a row of plants that ranged from sweet to genuinely punishing. Nothing was mislabeled. The labels were just wrong.
Start with what the flower already did for you
Tomatoes, beans, peas, and lettuce are in the pile that needs nothing. The mechanics are the point: a tomato anther forms a cone and drops its pollen straight down onto the stigma inside it. A pea and a bean pollinate in the bud, before the flower ever opens. Lettuce florets do the same. There is no window in which a bee can get in there first, which is why a beefsteak and a cherry tomato can grow a foot apart and still breed true.
Is it literally zero? No. Beans will outcross at a low rate in a good bee year, and tomatoes can pick up a stray cross now and then, especially the potato-leaf types with exerted stigmas. But low is low. If you are saving for your own garden and not for a catalog, a few feet between tomato varieties, or just a different pot, is realistic. I don't bag tomatoes. I do grow them in different corners, mostly out of habit.
Peppers are the ones that will surprise you
For peppers I bag. Not the whole plant, just individual buds. An organza drawstring pouch about three inches across, the kind sold for wedding favors, slipped over a bud that is swollen and pale but still closed, drawn snug around the stem, and tagged with tape and a date. The flower opens inside the bag, self-pollinates on its own schedule, sets fruit, and swells. Ten days later I slide the bag off and leave the tag on the stem. That pepper is seed stock; the rest of the plant is dinner.
The failure I see people make, and the one I made, is bagging a flower that is already open. You have put a bag on a flower that has been available to every bee on the block since sunrise. The bag has to go on a bud. If you can see the petals unfurled, it's too late for that flower; find another one.
If you have more than a couple of plants, caging is faster than bagging. A length of floating row cover over a tomato cage or a bent hoop, clipped at the bottom with binder clips or binder-clipped to the pot rim itself, does the job for a whole pepper plant. Peppers do not need insects to set fruit, so under cover you just thump the stake or the cage every few mornings to shake pollen loose. That is the easiest barrier in the entire garden, and it works at any distance from your neighbor's plants.
Caging squash works, but the timing is the whole trick
Squash and cucumbers are the opposite problem. They have separate male and female flowers, each open for roughly one morning, and they absolutely need pollen moved. Cover them and you have excluded the only thing that was going to do the job.
So the cage and the hand go together. Row cover over hoops, edges sealed against the soil or clipped to the container. Then, in the morning while the flowers are fresh, pick a male flower, peel the petals back to expose the anther, and rub it into the stigma of a female that opened that same morning. You can tell the female by the tiny fruit sitting behind the flower like a swollen bead. Do it before the heat builds, then close the cover back up. Skip the hand-pollination step and you get a lovely cage full of flowers and no squash, which is a confusing thing to be angry about.
There is a real tradeoff here that the tidy instructions skip. Keeping the cover on all season means no pollinators for the rest of the plant's life, and row cover in July on a sunny balcony can cook a squash plant by noon. What I do is define the window: cage early, hand-pollinate the first two or three females, tag the fruit, and once those are set and swelling, take the cover off and let the plant go for eating. Seed from those tagged fruits, eating from everything after. If you want seed from late fruits too, you have to put the cover back, and at that point you're running a full-time operation for one plant.
Brassicas are their own slow problem. They are biennial, so the plant you're saving from is the one that overwintered and bolted, and everything in that species crosses with everything else, including the kale and the cabbage and the Brussels sprouts you didn't think of as related. The second-year bed space and overwintering work are part of the decision to save them at all. Cage the flowering plant and hand-pollinate with a small brush, or bag individual racemes and work the brush inside the bag. Or just grow one brassica for seed and eat the rest.
Corn doesn't care about your row cover
Corn sheds pollen from the tassel onto the wind, and the wind does not respect hoops. The silks are receptive for a few days and each silk is attached to one kernel, so a cross shows up kernel by kernel on the cob. There is no physical barrier a home grower can realistically build against a neighbor's patch a few hundred feet away.
That leaves timing. One variety per season, and if anyone near you grows corn, arrange for your silking to miss their tasseling by two weeks or more, either by planting date or by choosing a variety with a very different maturity. It is a gamble, not a guarantee, and I would rather say so than pretend a tassel bag makes it safe. Bagging tassels and silks and hand-pollinating is possible and tedious, and it is the only route to certainty on a small plot.
One variety per species, unless the work is actually done
This is the rule I fall back on when I get ambitious in February. Among the crops that cross, save seed from one variety per species per season. One Cucurbita pepo. One Cucurbita maxima. One cucumber. One brassica oleracea. You can still grow the others. You just eat them.
Label more than you think you need to. A tag that says "bagged 7/12, self-set, no bee" is worth more in September than any memory of what you did in July. Distance is a field tool. Cloth and timing are home tools, and they work at five feet.