SAN FRANCISCO -- For the second night in a row, San Francisco Giants fans honored a longtime favorite possibly making his last start for the franchise.
Both sold-out celebrations ended as most Giants fans would dream -- with a win over the rival Los Angeles Dodgers.
Angel Pagan belted reliever Paco Rodriguez's third pitch for a home run leading off the eighth inning, breaking a 2-2 tie and sending San Francisco to a 3-2 win over the Dodgers in what might have been Tim Lincecum's final game as a Giant on Thursday night.
One inning after Lincecum, a pending free agent, left to a standing ovation, Pagan hit a line drive down the left field line that appeared destined for a double when it hit the top of the wall. However, the ball's momentum carried it into the runway near the left field bleachers, giving Pagan his fifth homer of the season.
Rodriguez (3-3) was pitching for the first time in eight days. He took over for Chris Withrow, who faced only six batters in preserving the 2-2 tie in the sixth and seventh innings after replacing Dodgers starter Edinson Volquez.
"Paco's all right," Dodgers manager Don Mattingly said when asked if the reliever's lack of recent use was an indication of an arm problem. "He got a pitch up. That's it. Other than that, he was fine.
"He needed to get back out there."
The loss almost assuredly secured the No. 3 National League playoff position for the Dodgers (91-68), who trail the St. Louis Cardinals (94-65) and Atlanta Braves (94-65) by three games apiece with three games to go in the regular season.
Unless the Dodgers sweep their three-game series against the Colorado Rockies this weekend and either the Cardinals or Braves are swept in their remaining games, Los Angeles will enter the NL Divisional Series as the third seed and open on the road against the runner-up in the race for the league's best record.
Mattingly clearly can't wait for the postseason, no matter where it is to begin.
"I can say I'd like to see this and I'd like to see that," he said after his club concluded a 5-5, three-city trip. "But it's all about how we execute (in Game 1) next Thursday."
In clinching their first winning month since May, the Giants rallied from a 2-0 deficit as Lincecum settled down after a shaky start.
The seven-year Giant completed seven innings, allowing just the two early runs on eight hits. He walked two and struck out six.
The 2008 and '09 Cy Young Award winner finished 2013 with a 10-14 record and 4.37 ERA, both far cries from his 89-70 and 3.46 marks over his San Francisco stint.
"It felt like the last game of the season, nothing more," Lincecum said. "I was focused on trying to get the win tonight."
Sensing the 29-year-old right-hander might have thrown his final pitch of the season, the sellout crowd gave Lincecum a standing ovation as he walked to the dugout after retiring the Dodgers in order in the top of the seventh.
The 41,221 were right. Johnny Monell pinch-hit for Lincecum in the last of the seventh, and when the Giants didn't score in the inning, the pending free agent -- like Dodgers starter Volquez -- finished with a no-decision.
Lincecum joked about the fans' response, which included a loud ovation following what turned out to be his final plate appearance.
"That was probably one of the best sacrifice bunts I've had in my life," he said with a laugh.
The no-decision kept Lincecum from potentially adding to an unwanted distinction. He leads all major league pitchers in losses in the past two seasons with 29.
The six strikeouts increased Lincecum's career total to 1,510. He previously joined Tom Seaver and Bert Blyleven as the only pitchers since 1893 to record at least 1,500 strikeouts in their first seven big-league seasons.
"We couldn't get him a win, but we won the game," Giants manager Bruce Bochy praised. "We all know what he's done. It's amazing what he's done at such a young age.
"We don't know what's going to happen. We hope he's here with us."
Santiago Casilla (7-2) earned the win after pitching a scoreless top of the eighth. Sergio Romo worked a 1-2-3 ninth to record his 38th save, closing out the Giants' 11-8 win in the season series.
Volquez, seeking his first win in five starts for the Dodgers, left for a pinch hitter in the top of the sixth with the score 2-2. He gave up two runs on four hits and three walks, and he struck out four.
The Dodgers got only one hit -- Mark Ellis' second double of the game -- over the final five innings.
Los Angeles scored single runs off Lincecum in the first and fourth innings to take a 2-0 lead, capitalizing on extra-base hits on both occasions. Carl Crawford scored after a one-out triple in the first. Juan Uribe and Ellis teamed to produce the fourth-inning run with back-to-back doubles.
The Giants got even in a two-run fifth that was capped by Brandon Belt's two-out, RBI double.
NOTES: Jonathan Denver, a 24-year-old from Fort Bragg, Calif., was stabbed to death four blocks from AT&T Park about two hours after Wednesday's Dodgers-Giants game. San Francisco police concluded the incident was sparked by the teams' heated rivalry, and two arrests were made Thursday. The clubs observed a moment of silence in Denver's honor shortly before the game. ... Dodgers RHP Brian Wilson, a former fan favorite while with the Giants, approached San Francisco vice president Larry Baer in his front-row seat immediately following the game and complained about not getting his 2012 World Series ring presented to him in a ceremony. ... Giants 3B Pablo Sandoval was a late scratch because of what was labeled flu-like symptoms. ... An MRI and CT scan performed in Los Angeles on Dodgers OF Andre Ethier's lower left leg revealed no stress fracture but showed he is not fully recovered from shin splints. Ethier is unlikely to play the rest of the regular season. ... The Dodgers announced before the game that LHP Clayton Kershaw was selected as the winner of the Roy Campanella Award, given annually to the club's most inspirational player.