The Goth subculture is influenced by Gothic literature(dark,horror fiction).
The word "gothic" is used to describe something barbaric or maybe just different/new.
I believe the architecture was called gothic because it replaced the older styles(like roman).
Well it all started with a band called Bauhaus and their 1979 song Bela Lugosi is dead. Goth as a phrase did not exist, but with hindsight we can say there were "proto-goth" bands [like Siouxsie and the Banshees, Joy Division etc.], mostly a mixture of experimental punk, glam, etc., but there was no subculture or even a unique genre yet. With time the media started throwing around the "Goth(ic)" word as a descriptive term to apply towards certain flavors of "Post Punk" music, but this came years later and even then was inconsistently applied.
Ian Astbury [of "The Southern Death Cult" & "Death Cult" & "The Cult" fame] claimed that "One of the groups coming up at the same time as us was Sex Gang Children, and Andi. He used to dress like a Banshees fan, and I used to call him the Gothic Goblin because he was a little guy, and he's dark. He used to like Edith Piaf and this macabre music, and he lived in a building in Brixton called Visigoth Towers. So he was the little Gothic Goblin, and his followers were Goths. That's where goth came from." [source] That's probably as accurate of an answer as you can get without building a time machine to ask Robert Smith himself in 1984 when he was samiltaniously playing as part of The Cure and Siouxsie and the Banshees. This actually gave him the unique distinction of being at the #1 position of the charts w/ 1 band, and the #2 spot with the other at the same time. A feat that to my knowledge has never been done by anyone else.
The Sex Gang Children hung out at this club, called "The Bat Cave" where most of the early goth bands got their start. The people who hung out there [audience & performers] were called batcavers, not goths and were known for their crazy appearance & stage personalities. But the media didn't like that term, and instead opted to use the word Goth(ic), a reference to Andy's nickname. The word was more or less forced on the scene, and not everyone was happy about it. One person who really disliked it was a guy named Andrew Eldritch [of The Sisters of Mercy] who went on the record circa 1987 to say that he would have prefered the new genre to be known as "Deathrock" like a similar [but not quite the same] music movement that had started in southern California around the same time [with bands like Rozz William's Christian Death, Ex-Voto, Voodoo Church, Death Ride 69 etc].
Somewhere in all this, the fans started taking on the stage appearance of the bands they listened to and that's really when goth as a subculture took hold. I forget exactly which band member, but someone from Theatre of Hate [another one of those batcave bands] told one story to the media where they had gone to a gig and noticed that some of the fans who were showing up were dressed more strangely than they were. To play a prank on the rest of the audience, they grabbed the first most-crazily dressed fans they could find, and put them on the stage to have them pretend to be the band. Once the show started they had someone in a suit go on stage to pull the fake-band members off stage & replace them with the real band, and the audience went crazy refusing to believe that the real band was the real band and figured some label executives had decided to pull the show & put some new sub-standard act on stage in its place.