NEW YORK, N.Y. - Brett Lawrie had struck out three times and was one pitch from making it four in a row. In a huge hole against one of baseball's most imposing pitchers, he guessed breaking ball.

And he guessed right.

Lawrie hit a leadoff homer in the 10th inning on an 0-2 hanger from All-Star reliever Dellin Betances, sending the Oakland Athletics past the New York Yankees 4-3 Tuesday night for their seventh straight road win.

"That's Brett Lawrie in a nutshell," said teammate Stephen Vogt, who had an RBI single. "We know he's going to clutch-up in the end. That's just who he is. He doesn't let his previous at-bats dictate how he's going."

Billy Butler launched a tying shot off Chasen Shreve in the sixth, and Tyler Clippard whiffed slugger Mark Teixeira with two on for the final out as the A's improved to 1-6 in extra innings. They had been the only major league team without a win after the ninth.

Oakland has won 12 of 15 meetings with the Yankees and 18 of the last 24. This one came thanks to Lawrie, who kept in mind that Betances throws more curves than fastballs.

"I just stuck with the curveball, caught it out front and yeah, it stayed fair. It was great. Good one for the boys," Lawrie said. "You've just got to have a short memory, short life and just keep pounding away. Get in the box, get ready to hit every single time."

Sonny Gray threw seven gritty innings for the A's in his return from an illness that sent him to the hospital and forced him to skip a start.

One day after he was selected to his first All-Star team, the diminutive right-hander gave up two runs in the first but settled in after that. He allowed three runs and six hits overall, lasting 110 pitches during his first career start at Yankee Stadium.

Gray began the day leading the AL with a 2.09 ERA.

"I felt a little rusty there early, but I felt like I was still making good pitches," he said. "As the game went on I felt like I got a little bit better and better and better."

Lawrie pulled his drive just inside the left-field foul pole for his eighth home run. Betances (5-2) snapped his head and shouted into his glove after giving up home runs in consecutive outings for the first time in his career.

"When you're ahead in the count, you have to put guys away. I left that pitch over the plate and he obviously crushed it," Betances said. "Last time I was fortunate that we won the game. Today we weren't able to do that. Just a bad pitch."

Filling in for injured closer Andrew Miller, the right-hander served up a tying drive in the ninth to Tampa Bay rookie Steven Souza Jr. on Saturday. Before that, Betances went 54 appearances without yielding a long ball.

Prior to Lawrie's big swing, batters were 0 for 15 with 11 strikeouts on an 0-2 count against Betances this year.

"It just doesn't happen very often," Yankees manager Joe Girardi said. "It happened tonight."

Drew Pomeranz (3-3) pitched two perfect innings, and Clippard got three outs against his former team to earn his 16th save in 18 attempts.

Grey made his first start since June 25, putting him on 11 days' rest. He was hospitalized for a couple of days last week due to gastroenteritis caused by a severe case of salmonella.

Girardi had a quick hook for starter Nathan Eovaldi with a 3-2 lead and one out in the sixth. The move quickly backfired.

The left-handed Shreve struck out Josh Reddick, but the right-handed Butler homered to left field on the next pitch.

"Reddick had hit him pretty hard and I had a fresh bullpen," Girardi explained.

After that, New York relievers retired 10 straight batters before Lawrie connected.

Brian McCann, Garrett Jones and Didi Gregorius had RBI singles for the Yankees.

Reddick delivered a run-scoring single in the first.

A-MATTER

Oakland improved to 7-21 in one-run games. ... The A's are on their longest road winning streak since taking 12 straight in 2012. ... A's pitchers did not permit an extra-base hit. ... Gray has not given up a homer in his last nine starts. ... Oakland is 4-1 against the Yankees this year, clinching the season series.

TRAINER'S ROOM

Athletics: LHP Sean Doolittle (strained shoulder) was set to play catch for the first time since going on the disabled list May 28 for the second time this season. He has appeared in one game all year and is eligible to come off the 60-day DL on July 27.

Yankees: The team plans to activate Miller and CF Jacoby Ellsbury from the disabled list Wednesday.

UP NEXT

Athletics: LHP Scott Kazmir (5-5, 2.56 ERA) pitches Wednesday night in the middle game of the series. He is 3-1 with a 1.53 ERA in his past five starts, including eight shutout innings of two-hit ball last Thursday against Seattle.

Yankees: LHP CC Sabathia (3-8, 5.59) starts against his hometown team on eight days' rest.