Erlin (3-3) allowed four hits and struck out seven over 7 2/3 innings before Luke Gregorson came on to record the final out in the eighth.
Huston Street put runners on first and third in the ninth before striking out both Yasiel Puig and Matt Kemp to end the game and record his 32nd save.
Jedd Gyorko drove in both San Diego runs, one with a ground out in the first and another with his 20th home run in the fifth.
Edinson Volquez (9-12) suffered the loss, allowing a lone run on five hits in 6 1/3 innings.
Swim Week Miami Beach 2014 [PHOTOS]