Updated

Two games, two dramatic wins. It may be just what the struggling San Diego Padres need.

Will Venable hit a two-run single in the 12th inning to give the Padres a 6-5 win over the Kansas City Royals on Monday night, their second consecutive victory in their final at-bat.

San Diego used Yonder Alonso's slow grounder to score Cameron Maybin with the game-winning run Sunday in the ninth inning of a 4-3 win over Arizona.

"Coming on the heels of (Sunday's) win, it's great," Padres manager Bud Black said. "We are seeing subtle signs. These are the kind of games that can lift guys."

Venable singled off Tim Collins (0-2) and over the head of right fielder Lorenzo Cain, driving in Chris Denorfia and Alonso.

Denorfia led off the inning with a single off Louis Coleman before Collins came on. After a sacrifice, Alonso reached on a bloop double to left to bring up Venable.

For the offensively challenged Padres, the two games may be signs that the team is ready to break out of its season-long funk. San Diego is ranked near or at the bottom in the majors in just about every offensive category.

"Bottom line, we just have to get a W," Alonso said. "I don't care how we do it. We have seen it all. This game will do a lot of crazy things on you. (Sunday), we get a game-winner on a bunt swing. (Monday), Will hit a mammoth single. This game will do a lot of things to you. You just have to keep your head up."

The Padres rallied back with a pair of homers to tie the game twice and force extra innings.

Jedd Gyorko, who is hitting.164, hit a solo homer with one out in the ninth inning off Royals closer Greg Holland to tie the game at 4. It was Holland's first blown save in eight chances.

Yasmani Grandal hit a three-run shot off Royals rookie Yordano Ventura in the sixth to tie the score 3-all.

"We are a team that doesn't give up, even if we are down by three runs," Alonso said. "We just keep chipping away, chipping away and the next thing you know we're winning the ball game."

Eric Hosmer homered and drove in three runs for Kansas City, which extended its season-high losing streak to five games despite a season-high 16 hits. Cain, who came off the disabled list before the game, had four hits.

The Royals grabbed a brief lead in the 12th inning when Mike Moustakas hit an RBI single to score Salvador Perez off Tim Stauffer (1-0).

"Any time you lose, it's painful, it hurts, especially when you are struggling a bit," Royals manager Ned Yost said.

Hosmer hit his first homer of the season, a solo shot off Nick Vincent, to put Kansas City ahead 4-3 in the seventh.

"We had plenty of opportunities to put it away," Hosmer said. "That's just the way things are going right now. This is definitely one of the tougher losses of the season."

Ventura had allowed just two hits in five shutout innings before giving up Grandal's homer. The right-hander allowed five hits, did not walk a batter and struck out a career-high 10 in six innings. Ventura extended his scoreless innings streak to 18 scoreless innings before Grandal's homer.

Ventura collected his first major league hit with a sharp single leading off the fifth. Nori Aoki followed with a single and both runners moved up on a fly out. Hosmer grounded a two-run single up the middle for a 3-0 lead.

Padres starter Eric Stults had his second tough outing as he lasted just 4 2-3 innings, allowing three runs and 11 hits. The left-hander tied a season high by allowing five runs over 2 2-3 innings — his shortest start since April 2009 — in his last start.

NOTES: Maybin left the game during the top of the seventh inning with a stomach ailment. ... Cain (left groin strain) was activated from 15-day DL and INF/OF Jimmy Paredes was optioned to Triple-A Omaha. ... Royals RHP Jeremy Guthrie (2-2, 4.50 ERA) faces Padres LHP Robbie Erlin (1-4, 5.83) on Wednesday night.