In theory, there is a way.
Have two different furniture stockpiles that only accept barrels. One gets the wooden ones the other takes the metal ones.
Either have the booze and food industry on different z levels, inhabitated by "hermit" style dwarves that only can access the according type of barrel (use chutes to enter the barrels and supplies for the hermits and to get out the stuff they produce).
Or lock up the doors of the barrelpile you dont want to use and only produce food and booze alternately. Yay for horrible, horrible complications and micromanagement galore.
Or maybe if you play around with the locations of the barrelpiles, the workshops and the meeting area you can get it to work somewhat automatically. hmmm.... I guess its nigh impossible, since its very hard to predict where your brewer or cook will be when they task up that job. But I THINK if you made sure the each workshop is closer to their according barrelpile, you will get only few barrels of the "wrong type" used up.
What I think will happen is: whenever a dwarf goes "on duty" and starts cooking/brewing, they will task up ingredients and barrels closest to them. At this point it's hard to predict where they are, so if you manage to place your shit smartly, you'll have a 50/50 chance of the dwarf using the "wrong" barrel. Now the dwarf completes his first job, and stays on duty, since they are probably rested and well fed. They'll pick the closest barrel again and the chance to grab the "correct" barrel is a lot higher now, since the according pile should be close. Use this method if you dont suffer from OCD
One more thing I could think of would be to exploit the fact you can store food outside of barrels. Make some 0 barrel stockpiles, branching out away from the booze industry... then, at the end ... oh wait, I think I didnt think that one through properly
And last but not least, I dont think it will work, but maybe it does: set the food stockpiles to "take from" the according barrelpile. Maybe it helps.
edit: All in all this sounds as if it could be complicated enough to be the sole purpose of one fortress