Updated

First place in the American League East will be on the line on Thursday when the New York Yankees and Baltimore Orioles begin an important four-game series at Camden Yards.

After Baltimore pulled even with the Yankees atop the division on Tuesday, New York managed to go a game ahead of the upstart O's on Wednesday, as they salvaged the finale of their three-game set with the Tampa Bay Rays, while Buck Showalter's crew lost in Toronto.

"This is what you think about as little kids," Yankees manager Joe Girardi said. "You imagine in your head about playing in important games in the backyard, and you think about it coming up through the Minor Leagues, that you want to be in this situation. It's exciting."

New York, of course, led the Orioles by 10 games on July 18, but won for just the fifth time in 15 games on Wednesday, as Ichiro Suzuki and Steve Pearce scored on Elliot Johnson's throwing error in the seventh inning and the Yankees escaped with a 6-4 victory.

Russell Martin hit a solo homer and knocked in three runs for the Yankees, while Alex Rodriguez added an RBI.

New York starter Hiroki Kuroda (13-10) gave up four runs on eight hits over six innings. The Japanese right-hander had lost his previous two starts.

"You don't want to get swept here," said Girardi. "We want to continue to try to play better and we had an outstanding game."

Baltimore, meanwhile, had a three-game winning streak stopped with a 6-4 loss to the Blue Jays. The Orioles had taken two of three from the Yankees in the Bronx last weekend, before winning the first two of their three-game set with the Jays.

If the Orioles are going to make any headway against the Yankees this weekend they will need to be better at home against them. The Yanks have won four of five in Baltimore this season and 21 of 29 there since last losing a series of at least two games there April 6-9, 2009.

"It's fun, I'm looking forward to it," said Orioles slugger Mark Reynolds, who is hitting .391 (9-for-23) with six home runs, 13 RBIs and eight runs scored in his last six games. "This whole weekend should be a great time."

The Orioles on Thursday welcome back righty Jason Hammel, who hasn't pitched since July 13 because of a knee injury. Hammel was 8-2 with a 2.61 ERA after beating Washington on June 22, but lost his next four starts and saw his ERA jump to 3.54.

"This is another level," Showalter said. "He's been out of this for a while."

He is 1-3 in 13 games (7 starts) versus the Yankees with a 6.75 ERA.

New York, meanwhile, will counter with right-handed rookie David Phelps, who did not get a decision on Saturday against the O's. Phelps gave up three runs and three hits in 4 2/3 inning of that one, but walked six batters in the 4-3 win.

Phelps is 3-4 on the year with a 3.13 ERA.

The Yankees have split 14 games with the O's this season.