Milwaukee's Ben Oglivie hit home runs in his first three at bats and drove in five runs as the Brewers beat host Detroit, 7-5, yesterday and gave the Tigers their seventh straight loss.

It was the second three-homer game of Oglivie's career. Both have come against the Tigers, who traded him to the Brewers for pitchers Jim Slaton and Rich Folkers in 1977.

''It was a little more sweet today because we are winning,'' said Oglivie, who was slumping with a .247 average at game time. ''I think we're on a roll right now. It's a good roll.''

The Tigers jumped to a 4-0 lead in the first inning. Chet Lemon walked, Enos Cabell beat out an infield single and both scored on Kirk Gibson's sixth homer, off Jim Slaton. Richie Hebner added a two-out solo homer, his third of the season.

Milwaukee got two runs back in the second when Ted Simmons doubled and scored on Oglivie's 13th home run, on a 3-2 pitch from loser Jerry Ujdur (0-2). In the Tigers' third, Lance Parrish hit a home run off Slaton, making it 5-2.

Simmons beat out an infield hit in the Brewers' fourth and rode home on Oglivie's second homer of the day. After two were out in the Milwaukee sixth, Simmons amd Oglivie each hit home runs off Ujdur to lift Milwaukee into a 6-5 lead.