Goth evolved from punk. Most of the important early goth bands - the Banshees, Joy Division, UK Decay- had at one point been punk bands, and something of the spirit of punk passed into the early goth movement.
By 1981, British punk had devolved into two main groups: Oi! and the anarcho movement centred around Crass. Neither side had much to offer musically, and some journalists looked to rising goth bands like Southern Death Cult as keeping the spirit of punk alive. Hence the tag Positive Punk which was applied to some of these bands.
Musically, many of the early goth bands differed from punk in that they'd discarded the use of buzzsaw guitars, instead using tribal drums with shards of guitar thrown over the rythm section. The lyrics and imagery were also changing, tending towards the dark and morbid rather than the straightforward and political. However, there was no clear dividing line, and many of the early goth bands played with and/or shared labels wirth punk bands.
From a fashion point of view, goth still shared much in common with punk, particularly as regards spiky hair, ripped clothing and mohawks (though the classic goth mohawk tended to be black and a lot wider). Since the Banshees were for a while still regarded as a punk band, the "Siouxsie-clone" look was by no means restricted to proto-goth girls, and a lot of the early gig-going crowd looked a lot more punk than goth.
As regards contacts between the subcultures, for a long time goth was part of punk, and it was a while before it became a subculture in itself rather than a subdivision of punk. After about 1983, however, goth had emerged as a separate subculture and became increasingly separate from punk in both music and style.