jagger “toothed chisel” – is clearly connected.
Dag is now obsolete, except in some English and Australian dialects where it refers to wool clotted with dung (and thus hanging down) on a sheep’s backside. Jag however persisted, for a time coming to mean any dangling clothing-accessory. Walter Scott sometimes used the word to refer to a pouch or saddleba.
But the relationship to cutting/ impaling/jabbing also developed, and in Scots this meaning has now become primary, both as a noun and a verb. Scott again, in The Heart of Midlothian (1818), offers a metaphorical example: “Affliction may gie him a jagg, and let the wind out o’ him”. The writer Allan Cunningham was doubtless thinking of such phraseology when he used the word in his long-forgotten romance Lord Roldan (1836): “‘What’s the sting of a nettle and the jag of a thorn to the scorching of eternal fire?” And of course you now know how mighty Partick Thistle acquired its nickname: ‘The Jags’.