Qualifying thanks to their Svenska Cupen triumph in May, Hacken were one of the unseeded sides in the First Round, and were under pressure in a first half which saw them lose Adam Lundqvist to injury early on.
The home side conjured up four shots in the opening 45 minutes to Hacken's zero, but Spartak did not manage to test Etrit Berisha in the visitors' goal.
Tempers began to boil over early in the second half, with a flurry of yellow cards handed out, before Hacken made Trnava pay for their lack of first-half cutting edge, as Severin Nioule broke the deadlock just past the hour mark.
That was one of only two shots on target the visitors had throughout the match, but it was two more than Spartak could manage, thus giving the Getingarna a 1-0 lead to take back to Gothenburg.
The second leg will be played next Thursday at the Bravida Arena, with a two-legged tie with Belgian giants Anderlecht the prize awaiting the winners in the Second Qualifying Round.
Follow the UEL Qualifiers on Flashscore.