Johnny Cueto handled the Cardinals from the mound, came through with an RBI To break a tie ball game and retired the final 17 batters he faced as the Giants beat the Cardinals 6-2 at AT&T Park.

The win gives the Giants a two-game lead on the Cardinals in the race for the National League wild card berths. The Cardinals are a full game behind the New York Mets for the second wild card.

The Cardinals run of three straight division titles ended as the Chicago Cubs clinched following the Cardinals loss.

“This is an important time for us,” Cardinals starter Adam Wainwright said. “We have time left. We have plenty of time left to make this happen. We’ve just got to play good games.”