Johnny Ray lined a triple down the left field line in the 17th inning tonight, driving in two runs and giving the Pittsburgh Pirates a 4-2 victory over the Cardinals.

Dale Berra singled to left-center and Jim Morrison sacrificed him to second before Omar Moreno walked. Ray drove in both runners with a drive that sailed over the bag at third base and caromed off the wall in left.

The game was the longest in the National League this year, lasting 4 hours 55 minutes. The San Diego Padres and the San Francisco Giants played 15 innings on June 26.

The Cardinals left 24 men on base, a major-league record for a 17-inning game. The previous record was 23, set by Cleveland and Philadelphia in 1929. The overall record of 27 was set in a 20-inning game between Atlanta and Philadelphia in 1973.

The Pirates stranded 13 runners.

The winner tonight was Enrique Romo (6-2) who entered the game in the 15th and managed to work his way out of a bases-loaded, none-out situation.

Jim Kaat, the fourth St. Louis pitcher, worked six innings and was the loser; his record fell to 4-2. The longest previous outing this season for Kaat, 43, was five innings.

Pirates Manager Chuck Tanner was ejected from the game by first base umpire Bob Davidson in the top of the 14th after Tanner protested an out call at first.

The Cardinals tied it in the ninth. Tom Herr, who had five hits in the game, led off with a double off reliever Rod Scurry and Lonnie Smith singled to right to tie it 2-2.