Baseball-Giants top Cubs in 13 innings to stay alive