Zac Gallen had nine strikeouts over seven innings and James McCann scored the go-ahead run as the Arizona Diamondbacks beat the Philadelphia Phillies 4-3.