Before going into the in-depth discussion about which is more important, you must understand the basics. If something looks good but doesn't allow seamless usage, then it is a case of great UI with poor UX.
Similarly, if the design doesn't appear good but is capable of offering great usability, then it is an illustration of great UX with poor UI.
Now you understand that both are equally important. If you want to give an exceptional user experience and build a successful brand, you must focus on both aspects of design.