The night was cool and the temperature somewhere in the 60s, but Baltimore Orioles pitcher Scott McGregor worked up a good sweat.

In the locker room after tonight's game, as he walked to the water fountain to get a drink, his undershirt drenched, he appeared to be a relieved man. He had pitched a complete game to defeat the Detroit Tigers, 5-2, and in the process avoided his first losing season since his rookie year in 1977.

McGregor's victory gave the Orioles a chance to finish in third place ahead of the Tigers, a plateau they will reach if they win their final two games against Detroit.

McGregor (14-14) gave up nine hits, yielding a run in the fifth inning -- the result of a poor fielding play by left fielder Mike Young -- and a one-run homer to Tom Brookens in the ninth.

The home run, with one out, brought Manager Earl Weaver to the mound.

"The first thing he said was, 'Don't worry. I'll leave you in,' " said McGregor. "I didn't know what he was going to do, but I would have been upset if he had taken me out.

"I've got to give one of those up (the home run). It's part of this season."

For the Orioles, Fred Lynn hit a three-run homer in the third inning off Detroit starting pitcher Dan Petry (15-13).

With two outs, Cal Ripken on first base and Baltimore leading by 2-0, Petry walked Eddie Murray. Lynn followed with his 23rd home run halfway up the right field bleachers. When he crossed the plate, the Orioles set a club record of 808 runs scored in a season, breaking the mark of 805 set in 1980.

"I have had a fair amount of success against Danny," said Lynn. "I was looking for something inside, and he got a slider up.

"He's gotten me out with plenty of sliders before, but that was just too high. He didn't have control tonight, and that's what hurt him."

Petry gave up singles to Young and Larry Sheets after the home run and was relieved by Randy O'Neal, who shut out the Orioles on two hits thereafter.

The Orioles took a 1-0 lead in the first inning after Alan Wiggins walked, stole two bases and scored on Ripken's ground ball to first base.

They added another in the second on Floyd Rayford's double down the left field line, scoring Lynn, who had walked.