Updated

A spectacular diving catch by Washington center fielder Denard Span saved the game as the Nationals edged the San Francisco Giants, 6-5, in the middle test of a three-game set.

The Nationals had a 6-4 lead entering the ninth as Rafael Soriano took the mound, but a two-out RBI single by Brandon Belt brought the Giants within one. Soriano then gave up a single to Buster Posey, putting the winning run on first.

Hunter Pence was the next to bat and knocked an 0-1 slider deep into center field. Span went after the fly ball, slid down on one knee and caught it as he turned over on his back.

"I just put my head down and I looked up. I saw I was gaining ground on it and that's when I said I'd have a chance to reach for it," Span said. "Once I caught it, I just tried to hold onto it."

Span's catch helped keep the Nationals' momentum going, as they are now on a five-game winning streak. They are also one game shy of .500 and remain 8 1/2 games behind the Reds for the NL's second wild-card spot.

Nationals starter Jordan Zimmermann (14-6) allowed one run on six hits and a pair of walks over seven innings to pick up the win.

Tim Lincecum (6-12) got the start for San Francisco, but surrendered all six runs on seven hits and two walks over six frames.

The Giants have lost three straight and six of their last eight games.

San Francisco first got on the board in the second inning. Hunter Pence drew a one-out walk, stole second base, and scored on Roger Kieschnick's single to center.

However, Ian Desmond started the home half with a solo homer to left to tie the game at 1-1.

The Nationals then erupted for five runs in the fourth. Bryce Harper and Jayson Werth hit back-to-back singles to begin the frame. After Desmond grounded out, Adam LaRoche was intentionally walked to load the bases. Anthony Rendon ripped a two-RBI double to center and Kurt Suzuki's blooper to left plated LaRoche.

Following a sacrifice bunt by Zimmermann, Span was walked on a wild pitch that allowed Rendon to score. Ryan Zimmerman then brought Suzuki home with an infield single and Washington held a 6-1 lead.

"I was up to me to settle down that inning and limit the damage," Lincecum said.

However, the Giants came back with a three-run eighth. With one out, Belt crushed a 2-2 pitch from Ian Krol over the right-field wall for a solo homer. Krol was replaced by Ryan Mattheus, but he gave up back-to-back singles to Posey and Pence that was followed by a two-run double to right center by Pablo Sandoval.

Tyler Clippard stopped the rally by striking out Kieschnick and Gregor Blanco.

Game Notes

Soriano notched his 31st save ... Desmond has 51 extra-base hits, most in the league amongst shortstops ... Barry Zito tossed two innings of one-hit relief for San Francisco ... Belt is hitting .415 with four home runs, nine RBI and 12 runs scored in August ... Sandoval went 3-for-4 with two RBI. He entered the game 2-for-23 in his last seven games and 5-for-42 in his last 12 contests ... Washington's Dan Haren is scheduled to face San Francisco's Ryan Vogelsong in Thursday's series finale.