PITTSBURGH (AP) — Max Moroff was an unlikely candidate to come through in extra innings for the Pittsburgh Pirates. None of his six career hits had been walk-offs, and he was hitting just .115 in 52 at-bats

The 24-year-old rookie picked the right time for knock No. 7, lofting an RBI single to center in the 10th inning to pull the Pirates closer to the NL Central-leading Milwaukee Brewers with a 3-2 victory Wednesday night.

Moroff entered the game as a pinch runner in the ninth and scored the tying run, then turned around and drove in the winner on his first at-bat in the 10th.

"I was ready to hit from pitch one," he said. "It ended up going to 2-1 and I ended up getting jammed, but it ended up working."

As Moroff's hit bounced into shallow center field and Josh Harrison crossed the plate, Moroff raised his right arm high and ran to first base. Teammates piled around him in the infield, and Gregory Polanco hoisted the rookie into the air.

It's a familiar scene for the Pirates, who have won three games in the ninth or later since the All-Star break and have won 10 of 12 overall to pull to four games behind the first-place Brewers.

"It's obviously exciting when you get them," Harrison said. "The past couple have been very special. It's been guys' first ones. It's always exciting when you can lead the team out there walking it off."

Harrison had reached on a double against former Pirates reliever Jared Hughes (3-2), who got his first loss since April 18.

Pittsburgh blew a lead in the eighth before tying it in the ninth against closer Corey Knebel. Francisco Cervelli singled home Moroff, who was running for David Freese. The rally began with Freese's walk and Polanco's single. It was the fifth blown save this year for Knebel.

"If anything, maybe (Knebel's) breaking ball was a little bit off tonight," Milwaukee manager Craig Counsell said. "He had a good fastball, for sure. Polanco hit a ground ball and he walked Freese on a breaking ball. Cervelli gets jammed a little bit, but it falls in. ... It's just kind of one of those innings."

Domingo Santana hit a solo homer off Juan Nicasio in the eighth to give the Brewers a 2-1 lead. Santana also doubled and scored in the first and finished 3 for 4.

Tony Watson (5-2) pitched a scoreless 10th for the win.

Pirates starter Gerrit Cole went seven innings and struck out a season-high 10. It was the first time a Pirates pitcher has struck out 10 this season and the most for Cole since May 22, 2015. Six of his strikeouts were looking.

Milwaukee starter Zach Davies gave up an unearned run and eight hits over seven innings. He struck out four. Davies, who has 11 wins, was hoping to be the stopper for the Brewers, who have lost four straight.

He's not panicking yet.

"We're still ahead," Davies said. "I think that's what guys tend to forget is we built a lead for a reason. We know something like this can happen, but at the end of the day, we're still ahead."

The Pirates nearly scored in the second, but Davies made a diving stop on a suicide-squeeze attempt by Cole and recovered in time to throw out Cervelli at home. That was the last time the Pirates had a runner in scoring position until the ninth.

TRAINER'S ROOM

Brewers: 2B Eric Sogard (left ankle strain) made his first rehab appearance with Class A Wisconsin. He went 0 for 3 with a strikeout. Sogard has been on the disabled list since July 6.

Pirates: 1B Josh Bell did not start but is expected to be fine after getting into a collision at first base with Eric Thames on Tuesday. He went 0 for 1 as a pinch hitter.

UP NEXT

Brewers: Jimmy Nelson (8-4, 3.27 ERA) will pitch in the series finale. Nelson has a team-leading 11 quality starts.

Pirates: Jameson Taillon (5-3, 3.06 ERA) will start. He has the team's best ERA among starters, but the Pirates are just 6-6 when he pitches.

___

More AP baseball: https://apnews.com/tag/MLBbaseball