Hunter-Reay was passed for the lead with three laps remaining a year ago and went on to finish third. But after swapping the lead with Castroneves following a restart with six laps to go, it was the Andretti Autosport driver who made the final and decisive pass.
Castroneves finished second in his bid for his fourth Indy 500 victory. Marco Andretti was third and Carlos Munoz was fourth.
Kurt Busch was sixth in his first race of the day. He was expected to immediately fly to North Carolina for Sunday night's NASCAR Sprint Cup race.