Major Noah H. Ferry, formerly Captain of Co. "F", was killed on July 3rd. Also named on Gettysburg reports are Major Crowley P. Dake, formerly Captain of Co. "E", regimental commander on July 31, 1863, and Major Luther S. Trowbridge, mentioned by Custer as leading the regiment on July 17.
Trowbridge would have ranked either of the other two officers. Not having access to the actual regimental records, I can only assume that Captain Dake was promoted to fill the vacancy left by the death of Major Ferry.