SAN FRANCISCO — Joe Panik scored the go-ahead run in the seventh inning on Aaron Barrett's bases-loaded wild pitch, and the Giants beat the Nationals 3-2 on Tuesday night to return to the NL Championship Series.The wild-card Giants took Game 4 in the best-of-five Division Series and eliminated the Nationals by scoring on a bases-loaded walk, a groundout and a wild pitch. Hunter Pence turned in a defensive gem in rightfield.Santiago Casilla put the potential tying run aboard in the ninth on a two-out walk to Bryce Harper, then retired Wilson Ramos on a grounder to end it. Casilla was mobbed on the mound as fireworks shot off from the centerfield scoreboard.San Francisco travels to St. Louis for Game 1 on Saturday. It's a rematch of the 2012 NLCS, when the Giants rallied from a 3-1 deficit to beat the Cardinals on the way to their second World Series championship in three years.Bryce harper doubled to drive in Washington's first run in the fifth inning, then hit a homer in the seventh — into McCovey Cove — to tie it at 2.Washington had the top seed as the team with the best record in the National League at 96-66. But for the second time in three years the Nationals are out in the first round.