PHOENIX (AP) — A night after tying the game with two outs in the ninth inning before winning in extras, the Chicago Cubs had the tables turned on them in Arizona.

Ketel Marte hit a game-tying solo homer with two outs in the ninth off Cubs closer Adbert Alzolay, then Randal Grichuk won it with a pinch-hit RBI double in the 10th, lifting the Diamondbacks to a wild 12-11 victory on Tuesday night.

After splitting the first two games of the series, the teams play the finale on Wednesday, with first pitch scheduled for 2:40 p.m.

That’s also the finale of the Cubs’ three-city, nine-game road trip out West. Tuesday’s loss dropped them to an even 4-4 on the trip. They’ll return to Wrigley Field on Thursday night to host the Miami Marlins to begin a four-game weekend series.

Tables turned

On Monday night, Nico Hoerner scored from second base on a wild pitch with two outs in the ninth and drove in the go-ahead run in the 11th in Chicago’s 3-2 win.

The Cubs seemed poised to win another wild affair on Tuesday night, rallying from two three-run deficits.

Ian Happ hit a go-ahead grand slam, his first homer of the season, as part of a six-run seventh that gave Chicago an 11-8 lead. But it didn’t hold up.

The Diamondbacks slowly clawed back, cutting the margin to 11-9 in the bottom of the seventh on Blaze Alexander’s double and 11-10 in the eighth on Joc Pederson’s sacrifice fly.

Alzolay came in for the ninth, looking to protect a one-run lead and pick up his fourth save of the season. Things started well enough, as Alzolay needed just four pitches to retire his first two batters.

But on an 0-1 pitch, Marte ripped a liner that barely cleared the wall in right-center field. After an official review, the homer was confirmed. Marte finished with four hits.

“Regardless of the situation, the game has to be played the same way,” Marte said through an interpreter. “It’s not over until the last out is made.”

Alzolay followed by walking Corbin Carroll, who stole second, and walking Lourdes Gurriel Jr., but he got Christian Walker to ground out to second to send the game to extra innings.

The Cubs were unable to score Michael Busch, who started the top of the 10th on second base, for the go-ahead run, then Grichuk ripped the second pitch he saw from Drew Smyly (2-2) in the bottom of the 10th into the left-center gap, easily scoring Walker from second as Diamondbacks players poured onto the field to celebrate.

“It was a lot of ups and downs,” Grichuk said. “Thought we had it in the bag, then it didn’t look good, then we got back in there. Roller coaster of emotions for everyone, but it’s good to be able to come in and help the team win.”

Big offensive night

Happ hit his first homer of the season off lefty Kyle Nelson, turning on a cutter and sending a line drive into the Diamondbacks’ bullpen. Christopher Morel had a sacrifice fly and Garrett Cooper added an RBI single before Happ’s crucial homer.

Hoerner had four hits for Chicago, including a double and triple, Happ totaled three hits and catcher Miguel Amaya doubled, tripled and drove in two runs.

“Our guys did great. Nico had a huge night, Ian had a really big night,” Cubs manager Craig Counsell said. “We put 11 runs on the board. We just didn’t pitch well enough tonight.”

The game was marked by big swings, with the Diamondbacks taking a 4-1 lead after four innings. The Cubs responded with four runs in the fifth before the Diamondbacks scored four runs of their own in the bottom of the inning for an 8-5 advantage.

It was another tough outing for Cubs starter Kyle Hendricks, who gave up seven earned runs over 4 1/3 innings. The veteran right-hander has been hit hard in all four of his outings this year and now has a 12.71 ERA.

Meanwhile, Busch’s five-game streak with a homer came to an end. The Cubs rookie — who tied a franchise record with his long-ball streak — was 0-for-4 with a walk and run scored.

Gurriel hit a two-run homer and Pederson added a solo shot in the third inning to give the Diamondbacks a 4-1 lead. Gurriel has five homers and 20 RBI through 17 games.

Diamondbacks left-hander Tommy Henry gave up five runs and nine hits over 4 1/3 innings. Kevin Ginkel (1-0) earned the win with a scoreless 10th inning.

Trainer’s room

Cubs: Manager Craig Counsell told reporters that OF Seiya Suzuki (oblique) is likely out for around four weeks, but the team will have a better timetable once he’s symptom-free.

Up next

The teams wrap up the three-game series on Wednesday afternoon. The Diamondbacks will throw RHP Brandon Pfaadt (1-0, 6.48 ERA), while the Cubs counter with LHP Jordan Wicks (0-2, 5.68 ERA).