SAN FRANCISCO -- Tim Lincecum was coming out of the game anyway. He just made a dramatic exit after getting hit by a line drive.
"Timmy is fine," Giants manager Bruce Bochy said. "There were no problems there. He worked hard, and those guys made him work. It was a gutty effort. He has that ability to turn it up a notch when it's needed. He had some big strikeouts."
The two-time NL Cy Young Award winner was struck by Miguel Tejada's shot, which turned into a groundout that ended the sixth. Lincecum crouched close to the ground for a moment but walked off the field under his own power.
"It just skimmed my shoulder," Lincecum said. "I didn't see the ball coming back at me. It was hit pretty well, and it just kind of ricocheted off me. I was more shocked than anything. I really didn't know what to do, so I kind of just sat there, then thought, 'OK, I'm fine, I can get up now.'"
Lincecum (7-2) allowed two runs on eight hits and four walks. His three wild pitches were the most by a Giant in six years.
"A few balls got away from me," Lincecum said. "I had to battle out there, throw a lot of pitches. I'm not going to let it get me down."
"Huff and Uribe like to hit in those situations with runners on base and a chance to drive in runs," Bochy said. "They've both done a good job in that 3-4 hole."
"As many hits  as we got off a guy like that, we looked uncomfortable," Orioles manager Juan Samuel said. "We had a shot to win the game, so it hurts."
Jeremy Guthrie (3-8) gave up four runs on eight hits and matched his career-worst four-game losing streak.
"It was disappointing to give up the two runs in the sixth in a game I felt we could have won," Guthrie said.
Guthrie has allowed 11 of his 42 runs in the first inning, including two to the Giants. The Giants could've gotten more, except for a baserunning blunder.
Andres Torres drew a leadoff walk, and Huff hit an RBI double. Sandoval singled home another run but was called out for passing Uribe, who had come back to tag from first.
"Pablo said he'd never been in that situation before," Bochy said. "We might still be hitting in the first if a couple of innings don't happen. Juan was trying to make a heads-up play and move into scoring position, and Pablo was watching the ball."
The Orioles tied the game with single runs in the fourth and fifth. Lugo, Craig Tatum and Izturis each singled to open the fourth before Lincecum came back to strike out Guthrie, Corey Patterson and Tejada.
Lugo, a last-minute replacement for Scott Moore in the starting lineup, also singled home a run in the seventh to close the gap to 4-3.
Ishikawa and Schierholtz each singled home a run in the eighth.
The Giants have hit a home run in a season-high nine straight games. ... Lincecum struck out 10 or more for the 23rd time in his career. ... Huff's home run was a "splash hit," the 52nd time a Giants player has reached the waters of McCovey Cove on a fly since the park's inception. ... The Giants, with two days off in the next five days, moved RHP Joe Martinez into the bullpen. ... Samuel was inducted into the Hispanic Heritage Baseball Museum Hall of Fame on Tuesday. ... Lugo had four hits in his previous 29 at-bats before singling in three straight plate appearances.