KANSAS CITY, Mo. (TNS) — Ned Yost sat in an aircraft late Wednesday night, contemplating what exactly had gone wrong over the previous 72 hours. In three games since beefing up their lineup with a trade, the Royals had managed only three runs in Baltimore, the formula for the wrong end of a sweep.

The Royals manager eventually settled on the equivalent of a shoulder shrug.

"The ebb and flow of baseball," Yost said.

A trip home turned the tide once more.

The Royals halted a three-game losing streak with a 6-4 victory against the visiting Seattle Mariners, preserving their spot as the second wild-card team in the American League.

It wasn't an offensive explosion — the Royals collected eight hits — but after a streak of just three runs in 32 innings, it sure felt like it. Lorenzo Cain and Melky Cabrera issued back-to-back run-scoring singles in the deciding seventh, and Brandon Moss homered twice. After 13 scoreless innings dating back to Wednesday in Baltimore, the Royals (56-51) scored in four straight innings — two in the fifth, one in the sixth, two in the seventh and one more in the eighth.

Reliever Ryan Buchter picked up his first victory in a Royals uniform. Kelvin Herrera pitched the ninth for the save, retiring Nelson Cruz, who represented the tying run.

The Mariners (55-55) fell 2{ games behind the Royals for the second wild-card spot.

Ned Yost was ejected for the second straight night, the first time in his career he's been tossed on back-to-back games. More on that in a bit.

Back to the offense. In Baltimore, the Royals' lineup failed to make a dent against a rotation with an AL-worst 5.83 earned run average. The opposition Thursday wasn't much better on paper. Mariners right-handed starter Yovani Gallardo entered the night with a 5.34 earned run average.

The Royals had scored only three runs over 32 innings — and zero over the previous 13 innings — before Moss clubbed his first homer, which traveled 427 feet before settling into the seats.

That's directly after the deal to bolster the lineup. The Royals acquired outfielder Melky Cabrera from the White Sox on Sunday for a pair of minor leaguers.

They won for the first time since that move, with Cabrera playing his part.

Alcides Escobar led off the seventh with a single. After an Alex Gordon bunt moved him to second, Escobar advanced to third on an error that also allowed to Whit Merrifield to reach first base. Cain scored Escobar with a single to right, and Cabrera followed with another single to give the Royals a two-run edge, their first lead in 29 innings.

In the sixth, the Mariners elected to intentionally walk Salvador Perez for a preferred lefty-lefty matchup with Mike Moustakas. But Moustakas burned them for a single up the middle to tie the game at 3.

Guillermo Heredia had supplied the Mariners a 3-2 lead in the top of the sixth with a run-scoring single off Mike Minor, the first man to relieve starter Trevor Cahill.

As for that ejection ...

After Mariners third baseman Kyle Seager tucked a ball inside the right-field foul pole for a 1-0 lead, first baseman Danny Valencia attempted to replicate the feat. Valencia sliced a ball that hit either the railing or the foul pole first — depending on who you ask.

The ball was ruled a solo home run, and it was upheld after a review that spanned nearly three minutes. Yost popped out of the dugout to a rug the failure to overturn the call.

Both those homers came off Cahill, who made his second straight since joining the Royals via trade last month. Just like his first start, he failed to secure five innings.

On Thursday, he was removed after two outs in the fifth. He allowed only two runs, but that was after Minor stranded two runners in the fifth. In two starts with the Royals, Cahill's earned run average stands at 7.27.

Former Royals outfielder Jarrod Dyson tagged him twice for singles in his first game back at Kauffman Stadium since an offseason trade relocated him to Seattle. Dyson also stole a base off Salvador Perez for the second time this season.