The fifth-generation networks, designed to provide a better quality of service and spectrum utilization, are rapidly being deployed across the world. 3GPP has proposed a fairness criterion, referred to as “3GPP fairness”, for the coexistence of 5G New Radio in unlicensed spectrum (NR-U) and WiFi in Release 16. In this correspondence, we derive an analytical expression to determine if the 3GPP fairness is achieved in a given network configuration. We model achieving the 3GPP fairness as an optimization problem and show how to use Sequential Quadratic Programming to find the optimal 5G NR U parameters from a pre-decided range. We test the optimizer in various conditions and inspect the effect of various parameters. Our results reveal that the optimizer is able to predict the best possible parameters for 3GPP fairness and therefore the proposed method proves useful for tuning 5G NR-U parameters during their coexistence with WiFi.