Ramirez, Marlins top D-backs to end slide at 6