Vine was part of a 10-man group which got away early on the 170.3km ride from Olot to Pal in Andorra, before the Australian went for broke and held off the chasers for his third individual Vuelta career stage win.
Traeen (Bahrain Victorious) came in 54 seconds behind Vine, enough to move from 26th overall to the top of the general classification, with a 31-second lead over Frenchman Bruno Armirail, who finished fourth on the stage.
Italy's Lorenzo Fortunato (XDS Astana) was third over the line and is also third overall, while Vine's teammate Jonas Vingegaard dropped from first to fifth, two minutes and 33 seconds adrift of the new leader Traeen.
The riders were climbing from the start and the breakaway made their successful move on the first ascent, with Vine first over the summit of Collada de Sentigosa, as last year's mountains classification winner showed early signs of his climbing prowess.
Vine and his companions steadily increased their lead, overcoming the category one climb of Collada de Toses in wet conditions.
With 40 kilometres left to race, the relaxed peloton trailed by over six minutes, and while they later began to eat into the gap, it was too late to haul in the riders out in front.
Vine was again first to reach the top when they topped La Comella, and the Australian pushed ahead on the descent, pulling further away on the final climb to the finish and never looked like getting caught.
With riders like Armirail, Fortunato and Louis Vervaeke threatening Traeen's red jersey bid, the Norwegian launched his own attack which paid off for the 30-year-old who three years ago was diagnosed with testicular cancer.
The race continues in the mountains for Friday's stage seven, taking the riders 188km from Andorra la Vella to another category one climb finish at Cerler.