select any 2 of multiple inputs
Some ways to address this problem:

Get a bigger microcontroller.

Use the micro you do have more intelligently.  You apparently have a total of 7 connections to the micro available, since you say that two inputs and 5 select outputs would work.

Just connect the 6 signals directly to 6 micro pins, then do whatever selection you want to perform in firmware.  Very likely the 5 output pins you would use for picking the selection can be configured as digital inputs.

Step back and think about this at a higher level.  Consider what you are really trying to accomplish, without assuming a particular way of accomplishing it.  Your question smells strongly of being about the details of a particular way to addressing the problem, when the right solution is to address the problem in a different way in the first place.

To actually answer this (rather contrived) question, you have 30 possible mux configurations, so it is possible to encode those in 5 bits.  However, decoding from the 5 bits to the 6 separate mux control lines might be more complicated than you are willing to do.

In the arbitrary case, this can be done with a lookup table (memory) that has at least 5 address lines and 6-bit words.  Now you have the additional problem of getting the data into this memory somehow.

Another option is to multiplex the 6 bits into the two muxes.  You could do this with a 3-bit data bus and two separate clock lines for latching the data bus value in front of each of the mux select inputs.

It may also be possible to find muxes with a serial interface like SPI and IIC, but I haven't looked and have never used such chips.

The 6 mux control lines could come from a shift register with a output latch.  That would only require 3 data lines from the micro: Data, Clock, and Latch.