For the fourth time, 46-year-old knuckleballer Phil Niekro failed tonight in his effort to win career game 300. Had the gray-haired right-hander been just a little sharper and able to stay around for the finish, he would have become the 18th pitcher in history to reach that coveted 300 plateau.

His New York Yankees teammates rallied for three runs in the ninth inning to defeat the Baltimore Orioles, 5-4, and cut idle Toronto's American League East lead to five games and put the Blue Jays' magic number on hold at three.

Don Mattingly crushed his 34th home run deep into the right-center field bleachers for two runs to tie the game, and after Dave Winfield had a double to right center to finish reliever Don Aase, Don Baylor drove in his third run of the game, against Sammy Stewart, with an opposite-field single to right.

But by that time, Niekro had departed after an unimpressive performance, giving up four runs, 12 hits and six walks over 7 2/3 innings. After struggling all the way, falling out of a 2-2 tie in the seventh, then giving up an eighth-inning homer by Wayne Gross -- Gross' first RBI since Aug. 12 -- Niekro was relieved with the bases loaded and two out in the eighth.

Everything seemed in order for what would have been a touching victory by Niekro. The pitcher spent Sunday at the bedside of his ailing 72-year-old father in a Wheeling, W. Va., hospital. Earlier today, Niekro called Yankees Manager Bily Martin and told him he would report to the stadium and take his regular turn in the starting rotation. But while the Yankees' eventual victory pleased Niekro, he was crestfallen as he was pulled from the game, leaving his glove in dejection on the dirt in front of the Yankees dugout as he trudged down the steps.

After the game, Niekro sent a message via a Yankees spokesman from his hideaway in the trainer's room that he "would rather not" meet the press. But after about a 20-minute delay, Niekro emerged to say he simply "was off with the knuckleball" and emphasized that his back-and-forth travel to Wheeling, which is near the Niekro family home in Lansing, Ohio, did not affect his performance.

Martin said he would send Niekro to the bullpen starting Tuesday in an attempt to get his 300th victory. But Niekro said, "I told him not to do that. The bullpen is doing a fine job. There's no sense interrupting what they're doing."

Niekro will have one more opportunity as a starter in this dwindling season, probably against Toronto in the season closer. He last won Sept. 8 against Oakland, then lost five days later to Toronto before being hit hard in his last two losses, both to Detroit.

He threw 161 pitches in his contest with Orioles left-hander Mike Flanagan, who had beaten the Yankees seven straight times since Aug. 15, 1980, including the Orioles' lone victory this season against New York.

But with the Yankees still mathematically alive, Martin could not afford to dawdle any longer with Niekro in the eighth inning tonight.

"It was a tough decision," Martin said, "but I couldn't let them get any farther ahead. I was rooting for him just as hard as anyone else. He told me after the game, 'You had to get the win.' "

"I was surprised he didn't come and get me sooner," Niekro said.

Although Flanagan also wasn't enjoying a spectacular night, he was stronger than Niekro, and that looked good enough for the Orioles until they were betrayed by their bullpen. Baltimore took a 1-0 lead in the third inning when Alan Wiggins walked, stole second and scored on a looping opposite-field double along the left field line by Eddie Murray.

Baylor opened the Yankees fourth with his 23rd home run of the year, a middle-deck shot to left off a fat 2-0 pitch.

The Orioles regained the lead in the fifth. Jim Dwyer doubled into the right field corner, moved to third on Cal Ripken's single to left, and scored on Murray's fielder's-choice infield chopper.

The Yankees tied at 2 in their fifth. Mattingly opened with a single to left center and moved to third when Winfield followed with a drive into the hole at short that Ripken failed to backhand as it rolled into left field. Mattingly scored on a deep fly to center by Baylor.

Fred Lynn drove in the Orioles' go-ahead run in the seventh before Gross finished off Niekro in the eighth with his homer.

Neil Allen, relieving Niekro, eventually ended the Baltimore eighth by striking out Murray with the bases full and went on to gain his first decision as a Yankee.

Much of the crowd of 15,041, disappointed that they did not see Niekro win, had left the park when the Yankees, led by Mattingly, Winfield and Baylor, scored three in the ninth to give the Yankees a sweep of the four-game series and 12 of 13 for the season series with Baltimore.

That left Niekro to talk not about a personal triumph, but the Yankees' pennant chances, which he said weren't over yet.

"Tonight's win will give Toronto something to think about before they go to bed," he said.