Cueto, Reds beat Pirates 5-4