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.
San Francisco scored two in the third, and Brandon Belt added an RBI single in the fourth. Hunter Pence followed with a two-run triple off Norris, who has lost his last three starts.
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.