CINCINNATI — If Wednesday was the Twins' last game before clinching an American League Central Division title, it was a fitting way to earn a trip to the postseason.

Thrilling, too.

The Twins built their roster with a focus on depth. After injuries to Carlos Correa and Royce Lewis in the past two days, Willi Castro turned into a one-man wrecking crew and Kyle Farmer provided the game-tying hit in the ninth inning.

Castro jump-started the offense on a day they struck out 14 times against Cincinnati Reds starter Hunter Greene, and Jorge Polanco — one of the longest-tenured Twins players — delivered a go-ahead, two-run single with two outs in the ninth inning as the Twins rallied for a 5-3 comeback win at Great American Ball Park.

The Twins' magic number to secure their first playoff berth since 2020 dropped to one with Cleveland's 6-2 loss to Kansas City, and they could clinch as early as Thursday.

"When it happens, no matter what it looks like, whether it's Thursday, Friday, later on throughout the week, that's special because it's a group of men that have set out to achieve something," Twins acting manager Jayce Tingler said. "It's not our big goal, but it's a step in what we're shooting for."

Castro, who supplied the lone blemish to Greene's outing when he hit a solo homer in the seventh inning, opened the ninth inning against Reds All-Star closer Alexis Díaz with a bunt single that rolled past the right side of the mound.

Castro took off for second base on Díaz's next pitch, and the throw from catcher Luke Maile skipped past second baseman Jonathan India and rolled into center field, allowing Castro to advance to third. Farmer blooped the next pitch into right field for a game-tying RBI single, only the third blown save of the season for Díaz.

"Bad Bunny, he's doing it all, man," Polanco said, referring to Castro. "He's robbing homers, hitting homers, diving catches. He's just a great ballplayer."

The Twins loaded the bases after Christian Vázquez drew a one-out walk and Ryan Jeffers was intentionally walked with lefthander Sam Moll on the mound. After a successful double steal by Farmer and Vázquez, the decision to walk Jeffers backfired when Polanco pulled a two-run single through the right side of the infield.

It was the fifth time the Twins won a game when they were trailing after eight innings.

"It just shows we're not going to give up no matter what's going on," Twins starter Bailey Ober said.

The Twins were the one team that passed over Greene in the 2017 MLB draft, and perhaps Greene wanted to show them what they were missing. His 14 strikeouts were the most by a Reds starter in a game since 2000.

Andrew Stevenson and Vázquez opened the third inning with back-to-back hits, but Greene pitched out of it after Michael A. Taylor's failed squeeze bunt and two strikeouts. The Twins didn't have another runner in scoring position until Castro's homer in the seventh inning.

"When those guys are throwing like that, there's not a lot you can do except battle," Tingler said. "That's what we did."

Ober, in his second start since rejoining the Twins' rotation, gave up two runs on three hits and three walks in five innings. He labored through a 35-pitch third inning, allowing an RBI single to TJ Friedl after a walk and a hit batter, and he stranded two runners in scoring position.

Reliever Josh Winder gave up a run in the seventh inning after Will Benson hit a leadoff triple that dropped between two fielders in center field. Maile hit an RBI single after a failed bunt attempt was ruled a foul ball on replay review, but Winder struck out two of the next four hitters.

"The ninth inning didn't happen unless we pitch and play [defense] the way we did," Tingler said.

For most of the season, the Twins could rely on their pitching. The offense was inconsistent. Wednesday could have been a day they tipped their caps to a young flamethrower. Instead, their potential final act before a division title was a comeback against one of the top closers in the league.

"That's what we play for," Polanco said. "That's what it's all about and we're just getting ready."