Development of novel ultraviolet (UV) upconversion materials has been emerging as a hot research topic for application in tunable UV lasers, photocatalysis, sterilization, tagging, and most recently luminescence thermometry. We readily synthesized a series of Ho3+/Gd3+ co-doped LiYO2 upconversion phosphors by a traditional high-temperature reaction. Under excitation from a blue ∼445 nm laser, LiYO2:Ho3+,Gd3+ polycrystalline powders yield intense sharp ultraviolet B (UVB) upconversion luminescence from Gd3+ 6Pj (j = 7/2, 5/2, 3/2) excited states. By means of steady and dynamic photoluminescence spectra, we systematically investigated the involved two-photon absorption upconversion as well as the accompanying energy transfer processes between Ho3+ and Gd3+ ions in the LiYO2 host lattice. Interestingly, the distinguishable UVB luminescence constituents from Gd3+ 6Pj excited states exhibit sensitive temperature dependence in a 353-673 K range. Shedding light on thermal equilibria between Gd3+ 6Pj UV-emitting levels, their luminescence intensity ratios follow Boltzmann statistics for the application of new luminescence thermometry. For the scheme of 6P7/2-6P3/2 thermally coupled levels, it works over a temperature range of 373-673 K with a maximum relative sensitivity (Sr) of about 1.07% K-1 at 373 K, and its 6P7/2-6P5/2 counterpart works over 353-533 K with a maximum Sr of about 0.83% K-1 at 353 K. Overall, our study provides a new pathway to develop UV upconversion materials, and promotes the application of Gd3+-related UV luminescence constituents in sensitive temperature sensing over a wide temperature range.