In times past, the only source of vinegar generally known was wine that, on turning, became sharp and acrid to the taste.
And it is precisely this that is shown by the name, for it comes from the Old French vyn egre (which led to the modern French vinaigre).
Vyn, or yin, comes from the Latin vinum, “wine,” and egre, or aigre, is from the Latin acer, “sharp, pungent.”