A six-game losing streak dropped the Baltimore Orioles several spots in the wild-card race. Back-to-back wins against the team with the best record in the AL would at least take some of the sting out of that.

Baltimore tries to send the Kansas City Royals to rare consecutive home losses Thursday in the conclusion of this four-game series.

Mired in their longest skid of the season, the Orioles brought out their power bats Wednesday after going deep once in the previous four games. Manny Machado, Chris Davis and Jonathan Schoop hit two-run homers off Johnny Cueto, and Steve Pearce and Ryan Flaherty added solo shots as Baltimore (63-63) beat Kansas City 8-5 to end an eight-game losing streak in the series - including four defeats in last season's ALCS.

More from FoxSports

"You're facing the best team in the American League last year and they've added players to improve on that," manager Buck Showalter said. "So it's a challenge, but we've got a chance to split against the American League champions (Thursday) and move on to Texas."

The Orioles, who held a wild card before the skid, trail Minnesota by two games in the crowded chase for the final playoff berth.

Mike Moustakas hit a two-run homer for the Royals (77-49), who had won four straight and nine of 11. They lead the AL Central by 12 games and remain comfortably ahead of Toronto and Houston in the race for home-field throughout the playoffs.

Kansas City is 44-21 at home, losing two straight there only once since early June.

Moustakas is batting .407 with four homers and 10 RBIs during a seven-game hit streak.

He's 3 for 8 with a home run off Chris Tillman (9-8, 4.51 ERA), who looks to rebound from his first loss in nearly three months. The right-hander had won a career high-tying seven straight decisions before allowing three runs over 6 2/3 innings Saturday in a 3-2 loss to Minnesota -- his first defeat since May 31.

Tillman has recorded quality starts in six of his last seven outings, going 3-1 with a 2.56 ERA and a 0.86 WHIP during that stretch.

He's 2-2 with a 6.75 ERA in six career starts -- playoffs included -- against the Royals, but threw a five-hitter in a 4-0 victory in his last appearance at Kauffman Stadium on May 16, 2014.

Kendrys Morales (5 for 9) has had the most success of any current Royal against Tillman, while Ben Zobrist (6 for 37), Eric Hosmer (1 for 11) and Salvador Perez (1 for 8) have all struggled.

Yordano Ventura (8-7, 4.64) looks to continue his resurgence for the Royals. After allowing 11 runs over 12 innings in his first two starts in August, the right-hander has gone 2-0 with a 1.42 ERA in his past three outings. He was very sharp in a 6-3 victory at Boston on Saturday, yielding one run and six hits over six innings while walking one and striking out six.

"For him, like it is for anybody, it's a confidence-type of thing," Perez said.

Ventura limited the Orioles to two runs over 14 1/3 innings in two regular-season starts against them last season, but wasn't as effective in Game 2 of the ALCS, giving up four runs, five hits and three walks in 5 2/3 innings.

Adam Jones homered off Ventura in that game and is 2 for 10 in their matchups. Schoop, Davis and Pearce are a combined 0 for 12 when facing him.