"He kind of goaded me into it," Dietrich said.
After being inserted into the game in the ninth inning as a pinch-hitter, Dietrich followed Barnhart's advice and hit a two-run homer in the 11th to lift the Cincinnati Reds over the San Diego Padres 3-2 Friday night.
"A lot of his home runs have led to wins," manager David Bell said. "He is doing a great job in the role he is in, being ready whether he is starting or coming off the bench."
Dietrich, who was among two Reds to make the club after being non-roster invitees in spring training, delivered in the clutch.
"I'm always expecting to come through in the big moments," he said. "Why else do you play baseball? Fortunately my spot came back around, and we were able to win a close ballgame."
Dietrich considered swinging at Craig Stammen's 3-0 offering, instead choosing to track it and set up his big swing on the next chance.
"He threw me the same pitch and I was able to put a good swing on it," said Dietrich, who leads the Reds with five homers.
Rookie shortstop Fernando Tatis Jr. opened the inning with an error, and Stammen (2-1) allowed Dietrich's homer two batters later.
Tatis -- who homered in the third inning -- singled off Zach Duke with one out in the bottom of the 11th, stole second and third, and scored on Eric Hosmer's groundout. Michael Lorenzen relieved and got the final out for his first save. Wil Myers struck out to end it.
The Padres have dropped five straight. They squandered an opportunity in the 10th following Ian Kinsler's one-out double that broke his 0-for-10 skid. When Kinsler tried to turn a walking lead at second base into a stolen base, Jared Hughes (2-0) adjusted his motion and pegged Kinsler at third.
"That was a smart move by Jared," Bell said. "If Kinsler makes it to third it changes the whole inning."
Both starting pitchers were sharp. Padres rookie left-hander Matt Strahm worked a career-high eight innings and surrendered a run and two hits with five strikeouts.
Strahm retired 23 of his final 24 batters as he rebounded in his second start at Petco Park after allowing five runs in his debut that didn't last three innings.
"He was great," manager Andy Green said. "I would have love to see him walk away with the win from that game."
Added Strahm: "I just had everything working for me. Attack the barrel and let the ball find the infielders."
Reds right-hander Anthony DeSclafani pitched six innings and was charged with a run, two hits and a walk in his best outing of the season.
DeSclafani struck out six and excelled despite three errors behind him. He stranded the go-ahead run at third base in each of his last two innings.
"I felt great today," DeSclafani said. "Everything was working for me. I just relaxed and threw strikes."
Tatis tied it at 1 with a solo homer, his sixth on the year. The 20-year-old extended his hitting streak to eight games and tied a Padres rookie record with three stolen bases.
Eugenio Suarez turned on Strahm's 0-2 pitch for his fourth homer to push the Reds ahead 1-0 in the first. Suarez snapped an 0-for-13 rut.
Reds: RHP Luis Castillo (1-1, 1.46) is 4-2 in his last nine appearances, which dates to September, and is scheduled to start game three of the four-game set.
Padres: LHP Eric Lauer (2-2, 4.91) is expected to make his club-leading fifth start.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Mariners' Gordon, Healy put on IL, Bass signed
The Mariners placed second baseman Dee Gordon and third baseman Ryon Healy on the 10-day injured list and signed right-hander Anthony Bass to a one-year contract with a $950,000 salary while in the major leagues.
Royals, Cardinals postponed, will play 2 Wednesday
The opener of the I-70 series between the St. Louis Cardinals and the Kansas City Royals was postponed because of a forecast for severe weather and rescheduled as part of a day-night doubleheader on Wednesday.
Rangers seek another big run total vs. Mariners
The Texas Rangers have beaten the Seattle Mariners three times this season, and all of the triumphs had a similar theme.
Orioles will try again to stop Torres, Yankees
The Baltimore Orioles have not been able to figure out a way to deal with New York Yankees shortstop Gleyber Torres.
Verlander aims to keep Astros on track vs. White Sox
Astros right-hander Brad Peacock provided Houston a strong pitching performance Monday that, in a vacuum, was more than sufficient for the opener of an extended four-game series.
Padres out to stop Diamondbacks, nemesis Greinke
When Zack Greinke walked off the mound with a trainer in the eighth inning last Wednesday in Phoenix, there was an audible gasp from Arizona Diamondbacks fans.