As long as they look different enough it could work.
Also, just in case you don't know: gobies are among the easiest fish to pair as they are capable of bidirectional sex change. The larger one will become male and the smaller one female, regardless if you put two males or two females together.