Richard (11-5) surrendered seven hits and two walks but got big outs when he needed them. He recorded two strikeouts as he raised his record to 7-2 since June 13 and led the first-place Padres to their ninth win in 10 games.
Gonzalez went 2-for-2 with three walks and scored three times. His third-inning, solo shot put San Diego up 3-1.
Matt Stairs smacked a two-run double for the victors.
Rookie right-hander Casey Coleman (0-1) took the loss in his first major league start, allowing three runs on six hits over 4 1/3 innings for the Cubs.