The replacement the Cardinals didn’t expect to use provided the runs they so desperately needed.

Matt Adams a midgame sub for injured first baseman Allen Craig homered twice in extra innings putting the Cardinals ahead in the 14th inning and again in the 16th to deliver a revitalizing 5-4 victory late Wednesday night against Cincinnati at Great American Ball Park. Adams became the first Cardinal ever to hit two home runs in extra innings according to Elias Sports Bureau.

The Cardinals rallied twice to tie the score in the first nine innings lost Craig in the fourth inning to a foot injury and had to collect themselves in extra innings after a blown save sent the game into the 15th inning.

“It was a crazy but awesome win” said starting pitcher Shelby Miller.

It could be a somber though necessary one too.

Craig wore a boot on his left foot and used crutches through the postgame clubhouse.

Adams who did not appear in the one-run loss to the Reds on Tuesday night entered to play first base in the bottom of the fourth. As long as Craig is out with the injured foot Adams figures to be the Cardinals’ everyday first baseman and a leading power source from the left side of the plate. The rookie slugger however was hitless in his previous 14 at-bats before replacing Craig and that would climb to zero for 17 before he came to the plate in the 14th inning.

He connected on a cut fastball for his 10th homer of the season.

Two innings later he laced Logan Ondrusek’s fastball with what Matheny called a “tee shot” – a clothesline from down in the zone straight to center field.

“That’s where my swing needs to be” Adams said. “Being able to stay through that ball down instead of trying to create leverage and lift it up.”

Said Matheny: “Nice time for Matt Adams to start feeling good at the plate.”

Adams’ homers won the longest game in the history of the Reds’ ballpark and it brought the Cardinals back from the brink in this series. The Cardinals had lost four of their previous five games hadn’t had a homer in any of the previous seven and were dropping closer to the third-place Reds than the first-place Pirates. The extra-inning victory the Cardinals’ fourth in nine tries this season put the Cardinals 2½ games ahead of the Reds. The Pirates’ loss in Milwaukee meant they had only a one-game lead on the second-place Cardinals.

Rookie Carlos Martinez got the victory as the punctuation on the end of a shutdown night from the rookies in the bullpen. Closer Edward Mujica failed to protect the one-run lead from Adams’ first home run in the 14th inning. For the second time in as many nights Reds prospect Billy Hamilton upended the Cardinals with a steal of second base. He scored on a single up the middle to retie the score at 4-4 and force the 15th inning.