Charge carrier-selective contacts transform a light-absorbing semiconductor into a photovoltaic device. Current record efficiency solar cells nearly all use advanced heterojunction contacts that simultaneously provide carrier selectivity and contact passivation. One remaining challenge with heterojunction contacts is the tradeoff between better carrier selectivity/contact passivation (thicker layers) and better carrier extraction (thinner layers). Here we demonstrate that the nanowire geometry can remove this tradeoff by utilizing a permanent local gate (molybdenum oxide surface layer) to control the carrier selectivity of an adjacent ohmic metal contact. We show an open-circuit voltage increase for single indium phosphide nanowire solar cells by up to 335 mV, ultimately reaching 835 mV, and a reduction in open-circuit voltage spread from 303 to 105 mV after application of the surface gate. Importantly, reference experiments show that the carriers are not extracted via the molybdenum oxide but the ohmic metal contacts at the wire ends.