B2 1023+25 is an extremely radio-loud quasar at z = 5.3 that was first identified as a likely high-redshift blazar candidate in the SDSS+FIRST quasar catalog. Here, we use the Nuclear Spectroscopic Telescope Array (NuSTAR) to investigate its non-thermal jet emission, whose high-energy component we detected in the hard X-ray energy band. The X-ray flux is ~5.5 × 10-14 erg cm-2 s-1 (5-10 keV) and the photon spectral index is ΓX ≃ 1.3-1.6. Modeling the full spectral energy distribution, we find that the jet is oriented close to the line of sight, with a viewing angle of ~3°, and has significant Doppler boosting, with a large bulk Lorentz factor ~13, which confirms the identification of B2 1023+25 as a blazar. B2 1023+25 is the first object at redshift larger than 5 detected by NuSTAR, demonstrating the ability of NuSTAR to investigate the early X-ray universe and to study extremely active supermassive black holes located at very high redshift.