Tough call, but I'll go with VI.
But first, some meandering thoughts on the runners-up as it all ties in:
II does return to a TV episode as plot inspiration, all while universe-building, looking into the philosophy of aging, and returning to a character deemed popular by fans -- let's face it, Khan's backstory is cool and Ricardo Montalban never less than magnetic in screen presence, but VI manages to create a new character that's just as magnetic, but isn't resorting the usual trope of "revenge against the protagonist". Let's face it, Khan's a bore once he'd be done with Kirk. Chang is conspiring, ironically with the enemy, to cause massive interstellar conflict all while the Romulan on display watches and giggles - which begs even more thought-chasing, and if Chang had won... oh, Chang (as well as Gorkon) also got a lot of goodies in the PC video game "Klingon Academy" and it sure was fun playing a Klingon to zappy-zap all the Federation ships with. Did Khan get a video game where you're helping him hijack ships to get at secret scientific experiments but only as desire to use them as weapons, forgetting that his superior brain might find said scientific goodies intriguing? Or even to take it and go build a garden somewhere to retire on, the way he was hoping to do after "Space Seed". Oh well.
III effortlessly continues what II started, complete with bringing Spock back from the dead and some interesting discussions about that along the way. A shame that Kirk's superior isn't Admiral Cartwright. The philosophical elements still rule the roost, as is the lengths Kirk goes to in order to try to save his friend as well as offering to help the Klingon Commander who just tried to kill him earlier, because - if for no other reason - the Commander was operating under a misunderstanding and not legitimate fear (never mind Kruge sorta murdered his kid as means to extort information, so this scene is BIG and for so many reasons.) This is another reason why I loathe IV outside of the courtroom scenes that helped ensure the trope would not be discarded, as it otherwise bypassed a shrewd and complex, multilayered and intelligent continuing arc that the 80s movies were in their stride with, in favor of a (now badly dated) comedy routine and some farting whales. Again, VI takes what II and II started and culminates in a gripping and tense movie. Maybe that's why I adore DS9 so much, with its arc of intrigue intertwining. DS9 took the style of the Kirk movies and took them to the next level. Even "For The Uniform" outdoes the tension and nautical flair of TWOK, which is not a simple task as TWOK is so eminently rewatchable.
Granted, VI relies on said arc of intrigue rather than conjuring something new out of thin air. But taking established characters, in the 23rd century, and doing something so unexpected. Yes, even enlightened 23rd century humans who came together still now have to practice the same thing with other species, who don't always feel the same way. The struggle never ends being another of the film's ideas it's playing with.
The best part is, there was no multi-year arc. This wasn't Babylon 5. Each new movie depended on the success of the then-current one, and the sequels were made on the fly. In ways, you'd think there was a plan. There wasn't. The plot elements were just there, waiting. The stories pretty much wrote themselves. At least for III onward; the drafts for TWOK were definitely variable and hasty ad hoc rewrites were needed thanks to leaks involving Spock's death. How much of it still ties in so well is something of a testament, when all is said and considered.