Chili Davis and Joe Morgan each singled home an unearned run in the eighth inning yesterday in Los Angeles to help the San Francisco Giants further tighten the National League West race with a 5-4 victory over the Dodgers.

With Atlanta's 12-6 victory over San Diego, Los Angeles is one game ahead of the Braves and two ahead of the Giants.

Dodgers Manager Tommy Lasorda, who missed Friday's game because of the flu, said, "I'm still upset, but it isn't just my stomach. We should have won, but we gave it away."

Fernando Valenzuela, seeking his 20th victory, instead was charged with his 13th loss. Rookie Andy McGaffigan notched his first major-league triumph. Greg Minton, who escaped a bases-loaded, two-out jam in the eighth, finished for his 30th save of the season and second in as many nights.

With San Francisco trailing, 4-3, in the eighth, Bob Brenly reached on an error by Bill Russell and Jim Wohlford was safe on Ron Cey's miscue. Davis singled home Brenly and Morgan delivered Wohlford with the tie-breaking run.

The Dodgers went ahead, 4-3, in the seventh when Russell, with his third hit of the game, drove in Derrel Thomas for the third time in the contest. Thomas led off with his third consecutive single, advanced to second on an error and scored on Russell's single.

The Dodgers broke their own all-time major-league season attendance record today when they drew a crowd of 49,634. The crowd boosted the Dodgers' season mark to 3,378,718 for 75 dates. They set the old record in 1978 when they drew 3,347,845 fans in 81 dates.