DETROIT — Manager Brad Ausmus stayed with Michael Fulmer, and it worked out quite well for the Detroit Tigers.

Fulmer pitched eight innings, Victor Martinez homered and Detroit snapped San Francisco’s six-game win streak with a 5-3 victory over the Giants on Tuesday.

Fulmer, who won the AL Rookie of the Year award last season, yielded a tying two-run homer to Brandon Crawford in the seventh, but Ausmus never considered pulling him.

“He’s earned that respect,” Ausmus said. “He’s been one of our best pitchers since the day he arrived and I wanted him on the mound.”

The Tigers responded with two runs in the bottom half on Justin Upton’s two-out, two-run single. Fulmer worked a perfect eighth and Justin Wilson got three outs for ninth save.

“It was huge to get a chance to finish the seventh and go back out for the eighth,” said Fulmer, who was named an All-Star for the first time on Sunday. “The offense picked me up and we got a big win.”

Fulmer (8-6) allowed two homers for the first time this season.

“We had a lot of good, hard contact,” Giants manager Bruce Bochy said. “We hit a lot of deep fly balls that didn’t go out. That’s this park — it holds balls in.”

Upton, who missed the previous three games with soreness in his side, went 3 for 3. Nicholas Castellanos also drove in a run for Detroit with a sacrifice fly.

Upton’s big day helped make up for the loss of slugger Miguel Cabrera, who left after six innings due to left hip tightness. Ausmus said he expects Cabrera to play on Wednesday night.

“It’s the same thing that has been bothering him,” he said. “It tightened up a little, but I’ll be shocked if he’s not right back out there.”

San Francisco right-hander Matt Cain (3-8) surrendered five runs and seven hits in 6 1/3 innings. He dropped to 0-7 in nine starts since beating the Dodgers on May 15.

“We’ve all been searching for wins, so I’m not going to have a pity party,” he said. “This was a tough one, because our guys battled back and we couldn’t pull it off.”

The Giants jumped in front on Hunter Pence’s two-out solo homer over the out-of-town scoreboard in right-center in the first. The drive ended Fulmer’s homerless streak at 73 2/3 innings – the longest active streak in the majors.

Martinez connected in the second and hit an RBI single in the fourth for a 2-1 Tigers lead.

The Giants flew out to the warning track four times in the first four innings, but only managed two hits. Fulmer’s command improved as the game went on, and he began to dominate in the middle innings.

“I really wasn’t comfortable early, and I was ending up in a lot of 2-0 and 2-1 counts,” he said. “I did some mental drills in the dugout between innings and I ended up finding the bottom of the strike zone again.”

San Francisco rallied in the seventh. Brandon Belt doubled with one out and Crawford followed with a drive to right for his seventh homer, tying it at 3.

NOT BAD AT ALL

Wilson is 2-2 with eight saves in nine chances since taking over the closer’s role in early May.

“I’ve just tried to treat it like I would any role in the bullpen,” he said. “I want to excel, and I want to keep the job.”

PAINFUL MEMORIES FOR TIGERS FANS

The Giants are the only team to clinch a World Series at Comerica Park, which opened in 2001. Cain started Game 4 for the Giants, who finished off a sweep of Detroit with a 4-3 win on Oct. 28, 2012.

TRAINER’S ROOM

Giants: INF Eduardo Nunez (hamstring) was taking ground balls before the game. Nunez played one minor league game on June 30, but didn’t feel comfortable. He’s now undergoing treatment with the Giants and no return date has been set.

Tigers: OF Jim Adduci (oblique) is close to 100 percent, but will remain with Triple-A Toledo to continue getting at-bats and playing center field.

UP NEXT

Giants: LHP Ty Blach (5-5, 4.60 ERA) will make the 14th start of his career in the second game of the series on Wednesday. Blach made his only interleague start on June 13, giving up seven runs to the Kansas City Royals in an 8-1 loss.

Tigers: RHP Daniel Norris (4-6, 5.00 ERA) pitches for the Tigers on Wednesday. He has never faced the Giants, but is 2-1 with a 4.58 ERA in five interleague appearances, including four starts.