Kuroda (6-8) allowed one run on four hits with no walks and six strikeouts.
Chan Ho Park came on with two out in the ninth to get the final out and his second save for the Dodgers, who have won three of their last five games.
Ramirez stroked a two-run homer in the first inning off Diamondbacks starter and loser Yusmeiro Petit (1-2), and then scored on a Jeff Kent single in the sixth. The Dodgers also got a second-inning solo homer and a double from Casey Blake.
Petit went five innings, giving up three runs on five hits with one walk and one strikeout.
Miguel Montero homered in the third for Arizona, which had a four-game winning streak snapped.