The 5G cellular network is expected to provide core service platform for the expanded Internet of Things (IoT) by supporting enhanced mobile broadband (eMBB), massive machine-type communication (mMTC), and ultra-reliable low latency communications (URLLC). Unmanned aerial vehicles (UAVs), also known as drones, provide civil, commercial, and government services in various fields. Particularly in a 5G IoT scenario, UAV-aided network communications will fulfill an increasingly important role and will require the tracking of multiple UAV targets. As UAVs move quickly, maintaining the stability of the communication connection in 5G will be a challenge. Therefore, it is necessary to track the trajectory of UAVs. At present, the GM-PHD filter has a problem that the new target intensity must be known, and it cannot obtain the moving target trajectory and the influence of the clutter is likely to cause false alarm. A UAV-PHD filter is proposed in this work to improve the traditional GM-PHD filter by applying machine learning to the emergency detection and trajectory tracking of UAV targets. An out-of-sight detection algorithm for multiple UAVs is then presented to improve tracking performance. The method is assessed by simulation using MATLAB, and OSPA distance is utilized as an evaluation indicator. The simulation results illustrate that the proposed method can be applied to the tracking of multiple UAV targets in future 5G-IoT scenarios, and the performance is superior to the traditional GM-PHD filter.