The Giants pieced together a rally in the sixth inning to tie Miami at 4-all, but J.T. Realmuto's eighth-inning jack put the Marlins over the top.