"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
Meadows' homer puts the O's on the wrong side of history
The Orioles set an MLB record for home runs allowed in a season with 259 after Austin Meadows drives an Asher Wojciechowski pitch over the wall.
Orioles set mark for HRs allowed in late-night loss to Rays
The Baltimore Orioles set the major league record for home runs allowed in a season, giving up drives to Austin Meadows and Willy Adames in a rain-delayed, 5-2 loss to Tampa Bay that ended shortly before 1 a.m. Friday.
Dodgers rally in 9th to walk off for 2nd straight game
The Dodgers come back in the ninth inning to tie the game then beat the Blue Jays on Enrique Hernandez's walk-off single.
Vlad Jr. doubles Blue Jays' lead with his 15th HR
Vlad Guerrero Jr. takes Kenta Maeda deep in the sixth inning to increase Toronto's lead.
Adames plays key role in Rays' win
Willy Adames' home run in the fifth inning tied the game vs. the Orioles before his two-RBI single in the sixth gave the Rays a 4-2 lead.
Syndergaard, Mets sweep Indians 2-0 for 5th win in row
Noah Syndergaard retired the first 16 hitters and allowed two hits over six dominant innings before a heavy storm interrupted him, and the New York Mets beat the Cleveland Indians 2-0 Thursday night in a rain-shortened game for their fifth straight win.