Giants starter Madison Bumgarner worked three innings, a spring high for a Giants pitcher. He yielded his only run in the second inning, when Kansas City opened the scoring on Paulo Orlando's double and Jorge Bonifacio's RBI single.
Posey delivered his two-out, go-ahead hit off Duffy to send home Joe Panik and Gordon Beckham, who singled back-to-back to open the Giants' third.
Mac Williamson's fourth-inning homer extended the Giants' lead to 3-1. The Royals steadily edged even, as doubles by Peter O'Brien and Raul Mondesi off Cory Gearrin generated a seventh-inning run before Hunter Dozier's eighth-inning homer off Roberto Gomez tied the score.