Dodgers beat Cubs 5-2 on Ramirez's 3-run HR