When a talented baseball team begins to awaken from a two-month slumber, it's important that the club not have its confidence pierced just as it begins to revive. That's why the New York Yankees were so relieved to beat the Baltimore Orioles, 5-2, tonight in Memorial Stadium on the strength of Ron Guidry's determined eight-hitter.

New York's victory, built around back-to-back third-inning homers by Jerry Mumphrey and Roy Smalley off complete-game loser Scott McGregor, was not so much a step forward as a vital avoidance of a step backward.

The Yankees arrived here with a five-game winning streak--virtually their first sign of life of the season. Losing a two-game miniseries to the hot Orioles would have been bad business. After Baltimore's dramatic, late-inning 5-2 victory Tuesday night, the Yankees faced one of those crucial games that dot any contender's schedule.

"There's no kidding ourselves, it was a big ballgame," said catcher Rick Cerone. "There's a lot of difference between being 3 1/2 or 5 1/2 games back."

The Yankees are still in fourth place, with a 35-31 record to the first-place Orioles' 39-28 mark. Their shaky starting rotation still includes (pick two of three) Roy Howell, Matt Keough and Bob Shirley. Their infield is unsettled. And the volcanic owner and manager still get along just as beautifully as ever.

But at least this evening the Yankees won a game when they felt it was vital. They'd lost their last 10 here in Memorial Stadium, dating back to October of 1981, and the feeling was growing between these clubs that the Birds had the Bronx boys' number.

Now, when the Orioles visit Yankee Stadium for four games next week, the New Yorkers may not have an inferiority complex. For the past two seasons, it has been the Orioles who have constantly been in just such positions, falling far from first place in May and June, then spending months chasing the leaders, only to fall short.

For the Orioles, this evening was a proof that all good things must come to an end. Their knack for beating up on the Yankees in this park was a habit they hated to abandon. In their last eight meetings here, they had won by an 80-51 margin.

"The crowd lets us know how important they think it is to beat the Yankees," said Ken Singleton, born a New Yorker. "Anytime the PA announcer even mentions that a car with a New York license has left its lights on in the parking lot, the fans boo like crazy. I think it goes deeper than just a ballgame to the people in Baltimore. New York represents the big shots, the guys with all the money.

"I don't know whether it makes us play harder, but it seems like a special feeling when we play the Yankees. I talked to my dad on the phone today and the last thing he said was, 'Go out there and kick those Yankees.' "

The visitors did the kicking this evening. After McGregor had retired the first eight, using only 22 pitches, 18 of them strikes, New York scored three runs almost instantaneously.

Andre Robertson ended McGregor's string with a single to left and Mumphrey, after fouling off one 2-2 pitch, golfed a knee-high fast ball into the jet stream that has been blowing toward left-center for the past two games. The wind wafted the ball into the bullpen. On the next pitch, a changeup, Smalley hit his ninth homer of the year, a poke to the bleachers in left that needed no help.

In a sense, those two swings were the whole game. The Orioles got a run off Guidry in the sixth when Cal Ripken doubled to left-center, took third on a fly out and scored on Gary Roenicke's sacrifice fly. And they got a window-dressing run in the ninth on Benny Ayala's double, Leo Hernandez's single and John Shelby's ground out.

The Yankees got a gift run in the seventh when Roenicke misplayed Graig Nettles' liner directly at him into a two-base error and rookie Don Mattingly's sacrifice fly scored Nettles. Mattingly got another discount RBI on a ground out in the ninth after the Yankees had loaded the bases on seeing-eye singles by Lou Piniella and Nettles and an intentional walk to Cerone.

Whenever Guidry needed to get tough, he did. With two on and none out in the third, Lou'siana Lightning got Shelby, Rich Dauer and Ripken on two flies and a strikeout. With men on second and third in the eighth, he set down Eddie Murray, Roenicke and Singleton on strikes and two pop outs.

Of that eighth inning, when Guidry talked Manager Billy Martin out of taking him from the game, Guidry (10-4) said, "That may have been the best inning all year for me and the team. It really gave us a lift to get those guys out. Especially Murray. He's such a great hitter and such a clutch hitter."

Only time will tell whether Guidry's grit on this gorgeous summer evening in Baltimore provided the New Yorkers with the first hints of a Yankee revival, or whether his work merely constituted a temporary reprieve.