AlGaN alloys have been widely used to make ultraviolet light-emitting diodes (UV-LEDs) because its energy bandgap covers 200-360 nm wavelength range. However, AlGaN shows strong transverse magnetic polarization in deep UV range, which severely prevents light extraction from top surface of UV-LEDs. In this paper, we propose a novel flip-chip AlGaN nanowire LED with top photonic crystals, for the purpose of improving light extraction efficiency (LEE) from top surface. Using three-dimensional finite-difference time domain simulation, we first investigate the LEE in vertical direction of nanowire LEDs. By carefully optimizing the size and density of nanowires, we demonstrate that nanowire structures can be designed to inhibit the emission of guided mode and promote light extraction from top surface. Based on the optimized nanowire structure, we also study the effect of top photonic crystals on the LEE of vertical emission. A high LEE up to 79.4% can be achieved by optimizing the height, spacing, and radius of top photonic crystals. Analyzing the lateral electric field distribution of AlGaN nanowire LEDs with and without top photonic crystals, we find that top photonic crystals can effectively improve the LEE of vertical emission by coupling the light trapped in epitaxial layers out of LEDs.