PHILADELPHIA -- Denard Span wasn't shy about putting a must-win label on an early August game.
"We needed this win more than ever," Span said late Thursday afternoon.
For the second day in a row, the Philadelphia Phillies and San Francisco Giants needed extra innings to decide a winner. In Thursday afternoon's series finale, Span helped reverse the fortune of the Giants, who fell in 12 innings Wednesday night.
Span's line-drive home run to lead off the top of the 10th inning off Severino Gonzalez gave the Giants a 3-2 win and avoided a sweep in Philadelphia.
Santiago Casilla pitched a clean 10th inning to earn his 25th save.
The win provided a positive feeling for a team that entered Thursday with a major-league-worst 4-13 record since the All-Star break.
"I'd say that's one of our bigger hits," Giants manager Bruce Bochy said of Span's homer. "It couldn't have come at a better time. These guys have been hard on us. It's good to get out of here with a win."
Matt Moore, acquired at the trade deadline from Tampa, made his first start for the Giants.
San Francisco (62-46) gave Moore a lead in the first inning off Phillies starter Vince Velasquez. Span led off with a single and later scored on a Brandon Crawford single as Velasquez struggled with his command early but got through the troubles only allowing that one run.
The Phillies (50-60) got the run right back in the bottom half of the first. Moore walked Cesar Hernandez to lead off the inning and then served up a run-scoring double off the bat of Phillies center fielder Aaron Altherr.
Both pitchers settled in during the middle innings.
After running up a high pitch count in the early innings, Velasquez lasted just five frames. In the fifth inning, after allowing a single to Joe Panik and walking Trevor Brown, the training staff came out to observe Velasquez, who had a blister developing on his right middle finger.
"I guess it started developing over time, a bullpen or something like that," Velasquez said. "(I) kind of aggravated it a little bit toward the end. But you've got to make adjustments.
"When I have a solid feel of the ball it kind of aggravates it a little bit, putting pressure, doing two-seam changeups, utilizing the middle finger pretty much every pitch."
Velasquez stayed in the game to finish the inning -- but not before Span's sacrifice fly scored Panik -- and was replaced by a pinch hitter in the bottom of the inning. He needed 93 pitches to get through those five innings in which he allowed two runs on three hits. He struck out six and walked three.
"I had to push myself and at least get to five innings," Velasquez said. "We used a lot of pitchers last night and starting out with 26 pitches in the first inning doesn't help. So I just had to make my pitches and manage to get through five."
"I didn't want to get him into a situation where he might miss his next start," Phillies manager Pete Mackanin said. "It wasn't a bad blister, but you could see it developing."
Philadelphia was able to get to Moore in the home half of the sixth. A single by Tyler Goeddel loaded the bases with one out for shortstop Freddy Galvis, who bounced a ball up the middle. The Giants were only able to get the out at second base, allowing Tommy Joseph to cross the plate with the game-tying run.
Moore scattered three hits and allowed two runs in six innings while striking out seven. But he had a career-high six walks.
"Maybe a tad bit geared up," Moore said of the early innings. "Giving up lead two times was not what you want to do."
But Span's late-inning heroics lifted Moore and put a stop to a third consecutive come-from-behind win for the Phillies.
"To get a win here (today) does a lot for the psyche and morale of the ballclub," Bochy said.
NOTES: San Francisco's acquisition of LHP Matt Moore from Tampa Bay forced RHP Jake Peavy to the bullpen. The veteran Peavy made his first appearance out of the bullpen in Wednesday extra-inning loss. ... Wednesday's come-from-behind win was the first time the Phillies came back to win a game they trailed by four or more runs in their last 41 tries. ... The Phillies optioned Wednesday's starter, RHP Phil Klein, back to Triple-A Lehigh Valley and recalled LHP Elvis Araujo prior to Thursday's game. But Araujo was sent back to Lehigh Valley after the game because Phillies closer Jeanmar Gomez (paternity list) will rejoin the team Friday. ... San Francisco continues its road trip Friday in Washington. ... The Phillies head back on the road for a westward swing, starting Friday night in San Diego.