From Middle English dagge, of uncertain (probably Germanic) origin, cognate with (Middle) Dutch dag, dagge, dagh. The sense "dangling lock of wool, matted with dung" (originally from the dialect of Kent) is also termed "daglock" (derived from the "hanging end" sense of "dag") or "daggle-lock" and some sources consider the sense a shortening of that longer word rather than a mere evolution of the "hanging end" sense.
From Old French dague (from Old Occitan dague, of uncertain origin, perhaps from Vulgar Latin *daca ("Dacian knife"), from the Roman province Dacia (roughly modern Romania); the ending is possibly the faintly pejorative -ard suffix, as in poignard); cognate with dagger.