SAN FRANCISCO (AP) - The San Francisco Giants' sputtering offense finally produced with runners in scoring position, and Tim Lincecum showed signs of his old dominant form after a shaky start.
Bruce Bochy's club still lost another close one at home with more close calls.
Hours after slugger Pablo Sandoval underwent surgery for a broken bone in his left hand, San Francisco rallied to score three runs against 2009 AL Cy Young Award winner Zack Greinke but couldn't complete the comeback in a 6-4 defeat to the Milwaukee Brewers on Friday night.
``To see myself, a guy who's been able to do things my way and get away with it, it's a little different to have to grind through things when you never really had to,' Lincecum said. ``I'm getting in modes where I'm overthinking things too much instead of just going out there and trusting. That's the biggest thing, go out there and have confidence in what you've got that day.'
Lincecum lasted five innings and continued to struggle with his control. He allowed two hits and had four strikeouts but walked four.
Since the start of the 2011 season, the All-Star right-hander leads the NL with 103 free passes but both Lincecum and Bochy are encouraged by the pitcher's latest outing, even if the numbers suggest otherwise.
``I have all the confidence in the world in him,' Bochy said. ``Looking back, I wish I'd left him in there, believe me. Like he showed the last three innings, it's there. He just gets out of sync.'
San Francisco's offense has endured its own funk most of the season and had another setback this week when Sandoval went on the 15-day disabled list. The team's top hitter, he is expected to miss four to six weeks.
The Giants went into the game 9 for 48 (.188) with runners in scoring position during their previous six games, including 0 for 5 in Thursday's 3-2 loss to the Marlins.
They fell behind 4-1 to Milwaukee before stringing together three consecutive hits in both the fifth and sixth to chase Greinke.
San Francisco's bullpen couldn't hold on, though.
Aramis Ramirez broke out of his slump with a go-ahead, two-run single in the seventh inning and Milwaukee sent the slumping Giants to their fourth straight loss at AT&T Park.
It is San Francisco's first four-game skid since Sept. 22-25 last year - and its first at home since dropping four in a row from Sept. 3-10 last year. The Giants were just swept by the Miami Marlins, losing all three by one run.
``Guys battled hard tonight, they did,' Bochy said. ``The offense had been sputtering, and we came to life. We found a way to get some big hits.'
Milwaukee had been shut out in its previous two games at San Diego and was playing without injured slugger Ryan Braun. The reigning NL MVP sat out to rest the sore right Achilles that forced him out in the sixth inning of Wednesday's game at San Diego.
Norichika Aoki and Rickie Weeks each hit a one-out single against loser Clay Hensley (1-3) and advanced on Corey Hart's flyout to deep center. Ramirez snapped a 2-for-19 skid and put Milwaukee ahead 6-4.
This game was decided well after Greinke outpitched his fellow 2009 Cy Young Award winner, and neither starter earned a decision.
Lincecum dug himself a quick hole.
The right-hander received a mound visit from pitching coach Dave Righetti in the first after throwing 11 of his first 13 pitches for balls, loading the bases on a walk to Ramirez. A wild pitch scored Carlos Gomez for Milwaukee's first run. Lincecum then allowed Jonathan Lucroy's two-run single up the middle.
His inning: 24 pitches, 10 strikes. He loaded the bases again in the second with two more walks, throwing 26 pitches.
San Francisco came back with three runs in the sixth to chase Greinke, who allowed three straight hits before Angel Pagan was called out on a close play at first. Pagan appeared to touch the bag with his left foot and beat the throw to Travis Ishikawa.
Pagan fumed and was held back and escorted away by first base coach Roberto Kelly as Bochy scurried out to argue with umpire Ed Rapuano.
The Giants tied the game at 4 when Brandon Belt reached on an error as the ball got under the glove of a lunging Weeks at second base.
On another close play three batters later, Emmanuel Burriss barely beat out an infield hit, though replays appeared to show he was out. Pagan clapped and cheered from the dugout as Brewers manager Ron Roenicke ran out to let Rapuano have it. Neither manager did enough to get ejected.
The Brewers settled down to regain the lead the next inning.
Kameron Loe (2-0) got two outs in the sixth and John Axford finished for his sixth save in six opportunities.
Pagan, Belt and Joaquin Arias started the fifth with three straight hits against Greinke to get the Giants on the board.
The Brewers added a run on Ishikawa's suicide squeeze in the sixth against his former club.
Bochy gave struggling shortstop Brandon Crawford the night off - and perhaps Saturday, too - a day after he committed two errors Thursday.
Pagan extended his career-best hitting streak to 18 games.
NOTES: San Francisco's Aubrey Huff, on the DL for anxiety disorder, said he's preparing to return Monday as planned. ``I hope so. A lot has been lifted off my chest the last two weeks,' he said, all smiles while soaking up the sun stretching out before warmups. ... Former Giant pinch-hit master Ishikawa started at 1B for the Brewers.
Copyright 2017 by STATS LLC and Associated Press.
Any commercial use or distribution without the express written
consent of STATS LLC and Associated Press is strictly prohibited.