SAN FRANCISCO -- Tim Lincecum knows he might not have made it through a start like this two years ago, when his best stuff wasn't there.
That's how far the Giants ace has come trusting that he can get it done no matter the circumstances.
Lincecum struck out eight to win his initial four starts for the first time in his career, San Francisco scored runs on a pair of errors and a wild pitch, and the Giants beat the St. Louis Cardinals 4-1 on Friday night to end a four-game losing streak.
Lincecum (4-0) -- the two-time reigning NL Cy Young Award winner -- has established himself as San Francisco's stopper, going 27-12 in 59 outings following Giants losses, including 3-0 this year. The Giants debuted their new orange jerseys for what's become a tradition known as "Orange Friday."
"You just come out and battle every time," Lincecum said. "Those are the days you really see what guys are made of."
Yadier Molina singled in St. Louis' run in the sixth, but the Cardinals could do little else against Lincecum. In 2008, the hard-throwing righty started 4-0 in his first five starts.
With Lincecum on the mound and the bright new look, San Francisco got back on track to kick off a nine-game homestand on the heels of a disappointing 1-5 road trip.
"We had to stop the little rut we were in," manager Bruce Bochy said. "He goes out and gives us a great effort against a very good ballclub."
The Cardinals (10-6) were off to an NL-best start, but now must win the next two games here to avoid dropping their first series of the season after capturing their initial five.
Lincecum, now with a 1.00 ERA, was done once he reached 120 pitches in seven innings. He allowed six hits and walked three. Sergio Romo pitched a scoreless eighth and Brian Wilson finished for his third save in as many chances, striking out the side.
"We rise to the occasion when we play good teams," Wilson said. "Pretty phenomenal [for Tim]. His pitch count was up there, but he's resilient. It doesn't matter how many pitches it takes, he's the guy."
Andres Torres led off with a double in the bottom of the first for San Francisco, coming around to score when shortstop Brendan Ryan's wild throw bounced into the stands. Mark DeRosa scored in the third on a fielding error by second baseman Skip Schumaker, then Aubrey Huff came home on a wild pitch by Jaime Garcia in the fifth.
"Guys aren't perfect," St. Louis skipper Tony La Russa said.
Nate Schierholtz singled in a run for the Giants.
Lincecum didn't care how San Francisco scored as long as it found a way after scratching out only five runs during the skid. The Giants figured it was about time a break went their way after the awful road trip.
"We've got to take 'em when we get 'em," he said. "Whether an error or a passed ball, be happy about it and take 'em as they come."
Garcia (1-1) didn't get much help from his sloppy defense -- or the offense -- in his first career appearance against the Giants.
"It's part of the game. Stuff is going to happen. You have to back up your teammates and limit the damage," Garcia said. "You just concentrate on what you can do. He's won two Cy Youngs. He's a great pitcher. We knew it was going to be tough."
The lefty held the New York Mets hitless for five innings last Saturday and scoreless for seven, but the Cardinals lost 2-1 in 20 innings.
This time, Garcia allowed four runs -- two earned -- on seven hits in six innings, struck out two and walked three. He also reached on an infield single in the fifth for his first major league hit.
That had to put a smile on the face of first-year hitting coach Mark McGwire, who was thrilled to be back in the Bay Area where his career began. The slugger played 11 seasons for the Oakland Athletics, winning a World Series in 1989.
McGwire signed autographs in the dugout before the game.
San Francisco snapped a three-game skid against left-handed starters.Notes
Giants SS Edgar Renteria was scratched after his troublesome left shoulder began bothering him again. Juan Uribe moved to SS to replace him and Matt Downs was inserted to play 2B. ... Wilson has held opposing hitters to just two hits in 21 at-bats over his first six outings. ... Cardinals SS Felipe Lopez was given an extra day to rest his sore right elbow. He hasn't played since Tuesday. ... St. Louis C Jason LaRue (sore right hamstring) rejoined the team in San Francisco and took early batting practice. He's on schedule to return from the disabled list Tuesday. ... The Giants drew 42,860 for their fourth sellout of the year.