A week after crashing out in the final lap at Phillip Island to allow Marquez win the season's penultimate race in Australia, Vinales built an early lead from second on the grid.
Vinales raced clear of his fellow Spaniard, who had crashed in qualifying and was forced to start the race back in 11th, only to fight his way through the pack and finish second, three seconds behind the winner.
Grand Prix Valencia
'An inspiration for me' - Federer leads Rossi tributes after final race
14/11/2021 AT 17:23
"I felt I had a big potential just passing the first lap," Vinales said afterwards.
"I took the lead in the first...and kept pushing, pushing, pushing. I'm so happy, the team did a great job."
Vinales dedicated his victory to Indonesian rider Afridza Munandar, who died after a crash in the Idemitsu Asia Talent Cup (IATC) race at Sepang on Saturday.
Marquez surged through the clutter to break into the top four in the first lap itself after a late switch to a soft rear tyre though Vinales continued to elude him.

KUALA LUMPUR, MALAYSIA - NOVEMBER 02: Marc Marquez of Spain and Repsol Honda Team rounds the bend during the MotoGP of Malaysia - Qualifying at Sepang Circuit on November 02, 2019 in Kuala Lumpur, Malaysia. (Photo by Mirco Lazzari gp/Getty Images)

Image credit: Getty Images

The Respol Honda rider said his strategy was not different from the one that paid dividends in Australia.
"It was an incredible race," said Marquez, whose points haul of 395 is now a new record in a season, eclipsing Jorge Lorenzo's 383 in 2010.
"Vinales was faster than us today and I saw that the chance was only like in Phillip Island - stay just behind him.
"Once he took [a lead of] one-second-and-half, I tried to keep there but then I did a mistake and it got to two-seconds- and-half. I'm happy for my race."
He too took a moment to condole the young rider's death.
"We cannot forget Munandar, he was a young rider. I met him once, he was a nice guy but unfortunately for [the] motorcycle [world], sometimes these things happen."
Ducati's Andrea Dovizioso finished third, denying Yamaha's Valentino Rossi a podium place.
Yamaha's Fabio Quartararo finished a disappointing seventh, failing to reproduce the speed which earned him pole position on Saturday.
Marquez had sewed up his sixth MotoGP title and fourth in a row in Thailand last month.
Valencia hosts the final race of the season on November 17.
Motorcycling
Rossi announces decision to retire at end of season
05/08/2021 AT 14:45
Motorcycling
MotoGP star Jason Dupasquier dies after crash
30/05/2021 AT 11:01