NEW YORK -- As messy as it was to get to this point, the Yankees still had a chance near the end on Tuesday night.

Down one run in the ninth with the tying run at second, Robinson Cano and Wilson Betemit struck out, extending New York's losing streak to three games with a 7-6 defeat against the visiting Orioles.

And as unattractive as his outing was, starting pitcher Darrell Rasner gave the Yankees a chance to win, but the offense and the bullpen didn't come through.

Rasner allowed two runs in six innings before he yielded a single and hit a batter -- perhaps grazing Adam Jones' jersey more than his left shoulder, really -- to start the seventh. Behind, 2-1, New York sent recently acquired Damaso Marte to relieve Rasner, and Marte subsequently allowed a single and two doubles, costing four runs. Two runs were credited to Rasner, and Marte's two were his first runs allowed as a Yankee.

As much as the Orioles earned their victory, they were still willing to keep the Yankees within reach.

Baltimore was comfortably ahead, 6-1, in the eighth before starter Daniel Cabrera was ejected for hitting Alex Rodriguez on his left shoulder. Bobby Abreu had already led off the inning with a double, and Jason Giambi followed Rodriguez by singling to load the bases with no outs. Cano's strong grounder into center field scored Abreu, but Rodriguez made a heads-up play by scoring from third after center fielder Jones leisurely threw to shortstop Juan Castro. Third-base coach Bobby Meacham tried to hold Rodriguez.

But with no outs, the bottom of the Yankees' lineup was retired and stranded Cano, one of 10 runners left on base. New York was 4-for-14 with runners in scoring position.

As for Cabrera's ejection, there was no warning issued, and he said the pitch was unintentional.

"My thinking with the ejection is when Alex came to bat the prior time, he had hit a home run [in the sixth inning] and the very next pitch his next at-bat was up toward the head area," home-plate umpire Chad Fairchild said. "I deemed that pitch intentional, and I removed Cabrera from the game."

Added manager Joe Girardi, who noted that Cabrera hit Johnny Damon in the hand on May 20: "I didn't like it. I'm not going to get into that. I'll just say I didn't like it."

Rodriguez didn't think much of being hit.

"I was glad to get on base," Rodriguez said. "I scored a run."

Rasner allowed a run in the first on Melvin Mora's RBI single but escaped further damage when he got out of a bases-loaded jam to end the frame. Rasner gave up eight hits and three walks with one strikeout.

"I had to battle from the get-go, I felt, with my command, and I got through that, so, personally, I felt good," Rasner said. "[It] just would have been nice to come away with a win today for the team."

It was Rasner's longest start since tossing eight innings on June 6 against Kansas City. After a four-pitch sixth inning, he was at 96 pitches. Because of a worn bullpen and prior success against Brian Roberts and Jones, he stayed in the seventh, Girardi said.

"They kept going at him and at him, and, unfortunately, the game got away from us a little bit in the seventh inning," Girardi said. "It was a little too much to come back."

With the Yankees down, 6-3, in the ninth, Mariano Rivera came in and yielded a leadoff home run to Aubrey Huff. Rivera, who's had trouble in non-save situations this season, said the pitch was supposed to be inside but instead was over the plate.

Were it not for Huff's homer, "We'd still be playing," Girardi said after the game. "We'd still be in the 10th inning. It's unfortunate, but we got behind and we chipped away and we came up short."