OAKLAND — Yonder Alonso hit a two-out, tiebreaking single in the seventh inning, Marcus Semien followed with a two-run triple and the Oakland Athletics held on to beat the Milwaukee Brewers 5-3 on Tuesday night.

Semien and Jed Lowrie had three hits each while Stephen Vogt and Danny Valencia added two hits apiece for the A’s, who won for just the second time in five interleague games this season.

Vogt tripled leading off the seventh against reliever Will Smith (1-2) and Valencia reached on an error by shortstop Jonathan Villar. After Vogt was thrown out at the plate on a grounder and Billy Butler struck out looking, Alonso singled off Michael Blazek to drive in Valencia.

Semien, who had three hits and three RBIs, then tripled to left-center on a 1-2 pitch to put the A’s up 5-2.

Sean Doolittle (2-2) retired three batters for the win. Ryan Madson pitched the ninth for his 13th save.

Ryan Braun hit an RBI double in the eighth to pull Milwaukee within 5-3, but the Brewers were shut down after that and fell to 1-7 on their nine-game road trip.

The A’s had lost two in a row and five of six before beating Milwaukee in the Brewers’ first trip to the Coliseum since June 12, 2002.

Milwaukee led 2-1 in the sixth after Braun scored on Chris Carter’s single following a two-base throwing error by starter Sonny Gray.

Semien’s two-out single off reliever Blaine Boyer in the bottom of the inning tied it 2-2 before his big blow in the seventh gave the A’s a cushion.

Gray allowed two runs over six innings and matched his season high of seven strikeouts but remains winless since April 22 — a stretch of nine starts.

Brewers starter Jimmy Nelson bounced back from his worst outing of the season and limited the A’s to one run over five innings while getting the no-decision.

TRAINER’S ROOM

Athletics: Outfielder Andrew Lambo, who was on Oakland’s opening day roster and played in one game after being claimed off waivers from Pittsburgh, is recovering after undergoing surgery last week for testicular cancer. ... Utility player Arismendy Alcantara was called up from Triple-A Nashville before the game. Left-handed reliever Daniel Coulombe was optioned down.

Brewers: Infielder Hernan Perez left the team to fly back to Milwaukee for the birth of his daughter and was placed on the paternity list. Yadiel Rivera was called up from Triple-A Colorado Springs to replace Perez on the roster.