The Giants scored three runs in the top of the ninth as the Cubs bullpen continues to struggle.
Pablo Sandoval hit an RBI single early in the top half of the inning before Brandon Belt had a two-run double to give the Giants the lead.
But, a Dioner Navarro home run to lead off the bottom of the ninth, tied the game at 3-3, before David DeJesus singled with two outs to set up Castro's heroics.
DeJesus and Castro each hit home runs earlier in the game as well for the Cubs.
It was an awesome game to watch and one worth the price of admission.