Trailing 6-0 early, the Diamondbacks battled back to pull within a run entering the seventh.
Sergio Romo came in to pitch, and Chris Young hit a bouncer to third baseman Pablo Sandoval. His throw home pulled Posey off the plate, but the catcher was given an error -- his second of the game -- as Hill scored the go-ahead run.
Wade Miley (1-0) earned the victory with four innings of shutout relief and Bryan Shaw tossed a scoreless ninth for his first save.
Jeremy Affeldt (0-1) was tagged with the loss for the Giants, who got a two-run homer from Posey.
Campus cop fatally shoots Texas student during traffic stop
Sign language interpreter at Mandela service called out as fake on Twitter