The Pirates avoided the final nail in a coffin so many have been building for them for more than a month again last night, winning a 5-4 first game of a double-header from the Philies on one of the oddest plays of the year.

With the score tied in the last of the ninth, catcher Ed Ott hit what seemed to be a harmless fly to right-center field. It would have been a routine catch for either the Phils' right fielder, Bake McBride, or center fielder Garry Maddox.

Neither caught it. Each politely stopped to let the other make the play and neither touched the ball until it had bounced over their heads and near the wall.

Ott was rounding second by the time Maddox fielded the ball and whipped it toward third. But it eluded Mike Schmidt, bounced into an area near the Phils' dugout populated by photographers and Ott scampered home with the gift run.

The play was scored as a triple for Ott and an error to Maddox on the throw. McBride seemed to have the easier catch - and for him it ruined an otherwise wonderful game. His two doubles had driven in all the Phils' runs.

This was yet another stroke of good fortune for a Pirate team that trailed the Phils in the National League East by 11 1/2 games Aug. 12. Philadelphia came into this first game of a four-game series needing to win only once for their third straight divisional championship.

Willie Stargell had lifted the Bucs into a two-run lead with a three-run homer in the sixth. But Philadelphia reliever Tug McGraw had provided two solid innings and Ron Reed seemed in control before his fielders failed him.

Ott had looked quite weak the first two pitches, barely managing fouls on each swing. One pitch later came his magic hit.

By the fifth inning, both Dick Ruthven and Bert Blyleven had, in their own fashion, been almost identically effective. The Phils had gotten only one of Blyleven's curves out of the infield and their only hit was a chop to third. Pittsburghhad three hits off Ruthven's slower pitches.

Then the hitters awoke.

Mike Schmidt led off the Philadelphia fifth with a sharp single to center. Catcher Bob Boone stayed with a Blyleven curve and tapped a single to left that just eluded the Pirate shortstop, Frank Taveras.

With runners at first and second, Taveras bobbled Ted Sizemore's one hopper just enough to spoil a double play. One out later, Schmidt and Sizemore trotted home as McBride's slicing double got by the Pirate left fielder by five yards.

In the sixth, the Pirates responded to the first sustained cheers and gained a 4-2 lead. Taveras tripled past center fielder Garry Maddox and scored on Omar Moreno's first-pitch dribbler past Ruthven.

Dave Parker followed with a sliding single that the diving Sizemore nearly turned into a sensational out. Stargell flicked his black bat at the first pitch and the ball leaped into the lower-deck stands in right for a three-run homer.

In the seventh Moreno seemed to have a chance at Boone's hard leadoff liner but it sailed over his glove for a triple. Sizemore popped to second, pinch hitter Tim McCarver walked and McBride did his two-run double number again.

This double whistled over Moreno's glove. Blyleven had control troubles, but got out of the inning wiht a 4-4 tie as Larry Bowa popped to second and Maddox grounded to second.

The Phils threatened in the eight off Pirate relief ace Kent Tekulve when Schmidt walked and stole second with two out. But Tekulve struck Boone out after beginning the battle with three straight balls.