The right-handed rookie also allowed one run and issued three walks, while tossing two strikeouts Tuesday at Marlins Park.
"It's great," Richards said. "Good to get that one out of the way. It has been too long so it's good to get it done and continue on from here."
Richards began the game by issuing consecutive walks. The Giants capitalized quickly with an RBI ground out by Brandon Crawford to take the early lead.
Miami rallied in the third inning. Starlin Castro plated Derek Dietrich on an RBI single before J.T. Riddle brought in Brian Anderson and Justin Bour on an RBI double to right field, giving the Marlins the two-run edge.
The Marlins' bullpen stepped up in the final three innings. Adam Conley, Brad Ziegler and Kyle Barraclough teammates up to allow just one hit, while tossing two strikeouts in relief. Conley and Ziegler each earned holds while Barraclough earned his fourth save of the season.
Castro was the only player with multiple hits in the game. The Marlins second baseman went 2-for-4 with an RBI and a strikeout. The Giants' 1-2-3-4 hitters went a combined 0-for-13 in the defeat.
Richards, 25, was 0-3 with a 5.02 ERA in six starts entering Tuesday's triumph.
"[Richards] has been a good story," Marlins manager Don Mattingly said. "He's throwing the ball well. Obviously Pitcher of the Year last year in the Minor Leagues. Really good reports on his makeup and how he works and competes and pays attention."
"It's good to see guys like that have success."
The third game of the four-game series is set for 7:10 p.m. Wednesday in Miami.