Yasmani Grandal has received repeated requests from the youngest of his three children, son Ryatt, and has answered with the same result.

“My 3-year-old keeps telling me to hit homers,” Grandal said with a smile. “Every time he’s said that, I’ve hit a homer, so he needs to keep telling me the same thing over and over.”

This time, Grandal gave him one to remember.

The Pittsburgh Pirates catcher sent a 1-2 fastball from Cincinnati Reds closer Alexis Diaz for a two-run homer and a 4-3 walk-off win Sunday afternoon before 18,653 at PNC Park.

It was the seventh home run of the season and the seventh career walk-off hit for Grandal, who was 0 for 3 when he came to the plate after Diaz hit Bryan De La Cruz with a pitch with one out in the ninth.

Grandal hadn’t played since catching Paul Skenes on Thursday, so his timing against fastballs was behind. Reds starter Nick Martinez threw seven consecutive cutters before getting him looking at a called third strike in the second inning, and Carson Spiers used sinkers to get a flyout and a groundout in Grandal’s next two at-bats.

“For some reason they thought I was sitting soft. I was just late,” Grandal said. “The first two guys did great. They went right at me, and I just didn’t have an answer for them. It just so happened that I did for him.”

Diaz threw a four-seam fastball down the middle for a called strike and another for a ball before getting Grandal to foul off a heater low and inside. When Diaz left a four-seamer just above the zone, Grandal drilled it 393 feet to right-center to clinch the Pirates (62-68) a win in the four-game series against their NL Central rivals.

“It’s one of those things where you may fool him once with a pitch, but very rarely do you fool him twice when he’s looking for it,” Pirates manager Derek Shelton said. “He got it, and it was a huge hit for us.”

Grandal caught six scoreless innings from Pirates starter Luis Ortiz, only for the bullpen to blow a two-run lead in a three-run seventh as the Reds got a combined three hits, two walks and a costly fielding error against Kyle Nicolas and Jalen Beeks.

Ortiz hit two of the first three batters he faced, plunking leadoff hitter Jonathan India in the shoulder and Tyler Stephenson on his elbow guard. A mound visit by Pirates pitching coach Oscar Marin got Ortiz to settle down. TJ Friedl reached on a fielder’s choice then stole second. But with a pair of runners in scoring position Ortiz struck out Spencer Steer to escape unscathed.

“He was missing by wide margins,” Shelton said. “For him to be effective, he has to pitch in and (Marin) did a good job of going out, calming him down and getting him back in his delivery. After that, you saw the elite execution that we’ve seen when he’s really been good. The most important thing there is the adjustment.”

The Pirates took advantage of singles by Isiah Kiner-Falefa — who reached second on an error by left fielder Steer — and Oneil Cruz to take a 1-0 lead in the first inning. Kiner-Falefa (3 for 4) scored from third on a groundout to second by designated hitter Joey Bart, who limped off with left hamstring discomfort and later was replaced by Connor Joe.

Another Reds error in the outfield led to the Pirates stretching their lead to 2-0 in the third. Friedl mishandled Michael A. Taylor’s single to center, allowing him to reach second. Taylor advanced to third on Kiner-Falefa’s groundout and scored on a single to right-center by Bryan Reynolds.

The Pirates, however, failed to build upon their lead when they stranded runners at second base in the fifth and sixth innings. They went 2 for 11 with runners in scoring position, leaving five on base.

“We had a couple opportunities that we didn’t take advantage of,” Shelton said. “At that point, yeah, you look back and think, ‘Yeah, that’s going to bite you.’ There’s a couple things that we have to be a little bit more aware of.”

Ortiz allowed a baserunner with two outs in four of his final five innings, but struck out Noelvi Marte to end the second, got Friedl to pop up to short in the third and Amed Rosario to fly out to center in the fourth. After a seven-pitch fifth inning, Ortiz encountered more two-out trouble in the sixth.

Steer hit a bloop single to left and Santiago Espinal followed with a double to put a pair of runners in scoring position and bring the go-ahead run to the plate before Ortiz got Dominic Smith to hit a high fly to Reynolds in left for the final out.

Kyle Nicolas replaced Ortiz in the seventh, when things spiraled for the Pirates. Marte hit a one-out single that deflected off Kiner-Falefa’s glove at third, and India doubled as the Reds put runners in scoring position again. The Pirates turned to Beeks, only for the lefty to give up an RBI single to Elly De La Cruz that scored Marte and cut the lead to 2-1.

De La Cruz advanced to second on Taylor’s throw to home, and Beeks intentionally walked Tyler Stephenson to load the bases. Then Friedl dropped a sacrifice bunt down the first-base line that Beeks bobbled for an error, allowing India to score the tying run and Friedl to reach safely. Steer drew a full-count, bases-loaded walk to give the Reds a 3-2 lead, and the Pirates pulled Beeks in favor of righty Dennis Santana to get the final two outs.

Aroldis Chapman (5-4) picked off De La Cruz, then struck out Stephenson and Friedl in the ninth. That set the stage for Grandal to honor Ryatt’s request with a raucous ending that made father wish he could have watched his young son’s reaction.

“I would have loved to have seen it, but I’ll FaceTime him and see what he says,” Grandal said. “The last four homers, every time I speak to him he tells me the same thing: ‘Dad, you need to hit a homer.’ All right, cool.”

Kevin Gorman is a TribLive reporter covering the Pirates. A Baldwin native and Penn State graduate, he joined the Trib in 1999 and has covered high school sports, Pitt football and basketball and was a sports columnist for 10 years. He can be reached at kgorman@triblive.com.