Keller (2-3) kept the Padres off balance by mixing his pitches effectively. He allowed two hits over 5 2/3 innings and struck out five.
''Trusting my stuff, going with the game plan,'' Keller said. ''I felt really good with my fastball.''
The right-hander entered with an 8.20 ERA after his first five outings this season.
''You have to tip your cap (to Keller),'' San Diego manager Jayce Tingler said. ''It's tough getting runs right now. We just don't have a lot of guys feeling it.''
Keller also got his first major league hit, a single to right field in the fifth.
''It felt great,'' he said. ''I have been searching for that one since 2019 when I first got called up.''
Four relievers combined to give up one run in 3 1/3 innings for the Pirates. Richard Rodriguez earned his fifth save by working a scoreless ninth.
''We have all the confidence in the world in our 'pen to get us out of stuff,'' Keller said. ''It's a great feeling.''
With two outs and the bases empty for San Diego, left fielder Ka'ai Tom made a jumping catch against the wall on a hard smash by Austin Nola that would have gone for extra bases.
The Padres activated right-hander Dinelson Lamet to make the start and he was on a strict pitch count. Lamet left his season debut after just two innings on April 21 with right forearm tightness. He lasted two innings and threw 30 pitches this time, giving up no runs and four hits.
''I'm back and I am building back up and that is what is important,'' Lamet said through a translator. ''Everything is a process. At the same time, I am taking everything day by day. I'm honestly not trying to be too anxious about it. Right now I am focused on feeling good and that's what I did tonight.''
Ryan Weathers (1-1) started the third inning in relief and promptly gave up a run on back-to-back doubles by Adam Frazier and Bryan Reynolds. Weathers got the next three batters to keep it 1-0.
Pittsburgh scratched a run across in the sixth against Keone Kela for a 2-0 lead.
With one out, Erik Gonzalez singled and stole second. He was running on a pitch hit by Jacob Stallings to Padres second baseman Jake Cronenworth, who threw to first to attempt to get the second out. But meanwhile, Gonzalez kept running around third and beat the throw home by first baseman Eric Hosmer, who was charged with an error for coming off the bag before the catch.
''My primary goal was to get to third,'' Gonzalez said through a translator. ''When I saw that situation happen I took a really good lead on it and I just said, this is my best shot to score.''
The Padres scored in the seventh off reliever David Bednar to narrow the gap to 2-1. With one out, Nola singled to drive in Will Myers from second base. Bednar struck out Ha-Seong Kim and retired pinch-hitter Fernando Tatis Jr. on a popup to end the threat.
''As a group we just aren't swinging like we are capable of,'' Tingler said. ''We are having a hard time stringing together two, three good at-bats in a row.''
Kim, who replaced Tatis at shortstop, made two outstanding defensive plays in the second inning, including sprinting for a ball in shallow left field and throwing out Tom at third.
''He saved a run there. The looping line drive, he had a great first step,'' Tingler said. ''He is doing a very good job defensively.''
Pirates: Placed OF Gregory Polanco on the injured list without giving a reason. ''I can't comment on any of that. He's on the IL. That's all I can say,'' manager Derek Shelton said.'' To take Polanco's roster spot, the Pirates selected OF/INF Hunter Owen, whose first action will be his major league debut.
Padres: Lamet was reinstated from the 10-day IL and RHP Miguel Diaz was optioned to the alternate training site.
Pirates RHP JT Brubaker (2-2, 2.63 ERA) pitches Wednesday against RHP Yu Darvish (3-1, 2.13) in the final game of the series.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.