You need to create some kind of manager class, which controls the logic of the control element. Add a script, which holds references to the buttons and create methods, which react to user input. In this manager you would build a dictionary of type (Button, int)(Button, int), or if it's easier for you a List of type (Button, int)(Button, int), which you fill at the AwakeAwake method of the class. You do this in order to create a relationship between a button and an index.
So, whenever the user clicks on a button, the manager saves the last clicked index. Now, when the user uses the keyboard, you check the last clicked index and depending on the direction of the keyboard input (up/down), you increase/decrease the index by one and look up the right button in the list. You then activate the respective button and update the last saved index. Make sure to catch edge-cases when the index reaches a value smaller than 0 or an index greater than the elements in the list minus one.
Best wishes