Yates, one of the race favourites, won the 9.2km battle against the clock around the roads in the Hungarian capital on Saturday, his time of 11mins 50sec edging out race leader Mathieu van der Poel by just three seconds.
But van der Poel, the brilliant Dutch rider for Alpecin-Fenix, was able to hold on to his pink jersey as race leader following his win in the opening stage on his Giro debut.
Team Jumbo-Visma rider Tom Dumoulin came third, five seconds behind Yates.
Yates, who is being backed by his Australian-based team to add another Grand Tour success to his Vuelta a Espana triumph in 2018, is now just 11 seconds behind van der Poel in second place in the general classification standings.
"For sure, this is my best time trial victory," reckoned the 29-year-old after his explosive effort over the short course.
"I'm, of course, very happy - it's a little bit unexpected. I was never confident to win until Mathieu van der Poel (the last to go) crossed the line."
Yates' fifth Giro stage win is the ideal platform for him as the race goes into the third stage of its Hungarian Grande Partenza on Sunday, a 201-kilometre trek from Kaposvar to Balatonfured which looks tailor-made for the sprinters.
INEOS Grenadiers' Richie Porte, in his last Giro, was the quickest of the Australian contingent in the time trial, 22 seconds down on Yates as 16th fastest.
The Tasmanian veteran is also the best-placed Aussie in the GC, in 13th, 33 seconds off the pace.
Lucas Hamilton was 25th on the stage, 2020 runner-up Jai Hindley 32nd, Michael Hepburn 34th and Callum Scotson 39th.
The Giro d'Italia continues with Stage 2 tonight, a 9.2-kilometre time trial in Budapest. Watch the full stage LIVE and FREE on SBS On Demand from 9.50pm AEST, with the SBS broadcast starting from 10.40pm AEST. WA viewers can watch via SBS VICELAND from 8.40pm AEST.