DETROIT -- This wasn't an ideal matchup for the San Francisco Giants - a rookie lefty against a Detroit lineup full of powerful right-handed hitters.
Ty Blach was up to the challenge.
Blach took a shutout into the seventh inning, and the Giants held off a late Detroit rally in beating the Tigers 5-4 on Wednesday night. Blach allowed only three hits in the first six innings.
"We just wanted to go out and attack those guys. Try to get ahead early and be able to change speeds, keep them off balance," Blach said. "We knew they were going to be aggressive, and we were able to do that."
The Giants led 5-0 before Detroit scored four times in the seventh. Blach (6-5) was pulled after allowing a two-run single to Victor Martinez, and San Francisco needed three relievers to get through the inning. The Giants used five relievers in all, with Hunter Strickland pitching the eighth and Sam Dyson finishing for his third save.
The last-place Giants have won seven of their last eight games - after losing 12 of 13 before that.
Daniel Norris (4-7) permitted five runs and seven hits in four innings.
"I don't know, mentally, physically, whatever, I've got to be able to get over that hump and make pitches when I have to," Norris said.
Blach won his second consecutive start following a rough stretch through the middle of June. He was charged with three of the runs in the seventh, but by then, the Giants already had a big enough lead.
Norris has given up five runs in each of those games.
"Clearly, we need better results," Tigers manager Brad Ausmus said. "It doesn't help us win games, and obviously it puts undue stress on the bullpen when they have to cover more innings."
The Giants nearly gave the whole lead away in the seventh. Miguel Cabrera singled to start the rally, and J.D. Martinez followed with a double. Victor Martinez's single made it 5-2, and George Kontos allowed a single to Mikie Mahtook.
Steven Okert struck out pinch-hitter Alex Avila, but Cory Gearrin came on and walked Jose Iglesias. With the bases loaded, Ian Kinsler hit a comebacker that bounced off Gearrin for a run-scoring single. A sacrifice fly by Nicholas Castellanos made it 5-4, but Justin Upton struck out to end the inning.
San Francisco leadoff man Gorkys Hernandez had three hits.
The Giants are 4-1 on their six-game road trip. The win Wednesday assured San Francisco of its first winning record on a road trip since going 3-2 from June 29 to July 3 last year. And that road swing began with a "trip" across the bay to Oakland for two games. "It's been a rough go," manager Bruce Bochy said. "It was a big win. It does secure a nice trip. We've got another big game, but it's just getting better all around."
Detroit activated OF Alex Presley from the seven-day concussion DL and designated OF Matt den Dekker for assignment. The Tigers also activated OF Jim Adduci from the seven-day DL and optioned him to Triple-A Toledo.
Detroit agreed to terms with first-round draft pick Alex Faedo, a right-hander who pitched at Florida.
Giants: LHP Madison Bumgarner (ribs, shoulder) allowed nine runs over four innings in a rehab start for Class A San Jose. He threw 76 pitches. ... 3B Conor Gillaspie (back) played in that game as well.
Tigers: Cabrera, who left Tuesday's game with left hip tightness, was in the starting lineup and had two hits.
Giants: RHP Johnny Cueto (6-7) takes the mound in the series finale.
Tigers: RHP Anibal Sanchez (0-0) tries for his third consecutive quality start.