Yes, the Dylan song is called North Country Blues. Growing up in Hibbing, a dying former mining town, he had plenty of inspiration for writing it.
Al Stewart took the melody, changed it slightly at the end of each verse, took some of the lyrical phrases, and wrote the Ballad of Mary Foster.
Dylan probably had borrowed much of the song from previous folk tradition too, so that's okay with me. Al Steward was obviously a big Dylan fan in his early period, covering "She Acts Like We Never Have Met" on one of the early albums, when he rarely recorded anything but originals. He then went on to write songs quite unlike anything anyone else has come up with...good for him!