[clasp, hook, fastener] late 13c., from Old North French taque "nail, pin, peg" (Old French tache, 12c., "nail, spike, tack; pin brooch"), which is probably from a Germanic source (compare Middle Dutch tacke "twig, spike," Frisian tak "a tine, prong, twig, branch," Low German takk "tine, pointed thing," German Zacken "sharp point, tooth, prong"), according to Watkins from Proto-Germanic *tag- (compare tag).
Specifically as "short, sharp-pointed nail with a flat head" by mid-15c.
In sailing by late 14c.; specifically meaning "rope or hooked wire to hold the lower corner of a sail in place" by late 15c. The extended sense of "course of a ship in relation to the position of her sails" is by 1610s. Hence the figurative use for "tactical procedure, course of conduct or mode of action suited to some purpose" (1670s), attested earlier in the verb (1630s).The notion is "temporary change in direction to take advantage of a side-wind."