David Peralta hit a go-ahead homer in Arizona’s four-run seventh inning, and the Diamondbacks rallied to beat the Colorado Rockies 5-3 on Tuesday night in Denver.A.J. Pollock and Nick Ahmed also homered, and Randall Delgado (2-0) got the win in relief of starter Patrick Corbin. Brad Boxberger pitched the ninth for his 22nd save.Nolan Arenado went deep and Tyler Anderson struck out eight in six innings for the Rockies. Anderson yielded one run on three hits and four walks.Anderson pitched his third consecutive strong game, but it was wasted in the seventh inning. Jake McGee (1-3) took over with a 2-1 lead to start the seventh, and he walked Jeff Mathis and gave up a pinch-hit double to Chris Owings. Peralta then drove an 80 mph slider into the seats in right to give Arizona a 4-2 lead.McGee left after Peralta’s blast to a cascade of boos from the announced crowd of 43,405.Scott Oberg retired the next two batters before Pollock homered to dead center to make it 5-2.Arenado hit a one-out homer, his 23rd, in the bottom of the inning, and Trevor Story and Ian Desmond had hits to put the tying run aboard, but Andrew Chafin got Geraldo Parra to ground out to end the threat.Ahmed gave Arizona a 1-0 lead with a one-out homer in the first inning. It was his 12th of the season.