Updated

Rookie Kolten Wong had four hits and scored twice, Peter Bourjos homered and the St. Louis Cardinals beat the Baltimore Orioles 8-3 Sunday to avoid a three-game sweep.

After allowing nine home runs in losing the first two games of the series by a collective 22-5 score, the Cardinals amassed a season-high 17 hits — 14 of them singles.

Bourjos capped the barrage with a three-run drive in the ninth off Zach Britton, ending the left-hander's run of 27 straight scoreless appearances at home.

Wong's four hits, all of them singles, matched a career high and lifted his batting average 11 points to .253.

St. Louis right-hander Lance Lynn (12-8) gave up three runs and nine hits over 5 2-3 innings, only the second time in his last 12 starts that he allowed more than two runs.

Nick Markakis had four hits for the Orioles, who went 2 for 13 with runners in scoring position. Caleb Joseph's streak of consecutive games with a home run ended at five, one short of the club record.

Orioles manager Buck Showalter was ejected after a replay overturned an out call on a force play in the top of the seventh. It was his first ejection of the season.

Baltimore starter Kevin Gausman (6-4) allowed three runs and eight hits in five innings.

The AL East-leading Orioles next host the New York Yankees for a three-game series that begins Monday night. New York trails by six games.

St. Louis went up 4-2 in the sixth on an RBI single by Daniel Descalso, but Markakis matched that in the bottom half with a run-scoring single.

Successive doubles by Descalso and Matt Carpenter, off Andrew Miller in the eighth, made it 5-3.

Gausman gave up four singles and a walk in a two-run first inning that ended when Matt Adams was thrown out at the plate by center fielder Adam Jones.

Baltimore answered in the bottom half on an RBI double by Nelson Cruz.

After Jon Jay singled in a run in the St. Louis third for a 3-1 lead, two singles and a wild pitch by Lynn cut the deficit to a run in the fifth.

TRAINER'S ROOM

Orioles: Shortstop J.J. Hardy was a late scratch from the starting lineup with a sprained left thumb.

ON DECK

Cardinals: Right-hander Shelby Miller (8-8) seeks his 25th career victory Monday night in the opener of a three-game series in Miami.

Orioles: Baltimore looks to improve upon its 6-3 record against the Yankees when Bud Norris (9-7) faces New York's Chris Capuano (1-2) on Monday night.