In this article, we propose a novel dynamic bandwidth allocation (DBA) algorithm for NG-PON networks to jointly support 5G fronthaul and best-effort data services in the same PON channel. The proposed self-adjusting DBA adjusts dynamically the allocation intervals to the current required fronthaul throughput based on the requests reported from the ONUs. It is suitable for dynamic 5G scenarios where, for energy efficiency reasons, the fronthaul connections are dynamically set up and torn down over time: when a new 5G fronthaul connection is set up, the maximum latency of the current connections is guaranteed while when a current 5G fronthaul connection is torn down, the freed transmission resources become available for data services. The only requirement is that the capacity of the channel in the NG-PON network is enough for the throughput of all 5G fronthaul connections supported by the channel. In this way, the proposed self-adjusting DBA algorithm has the advantage of requiring a much lower management coordination between the 5G infrastructure and the NG-PON infrastructure than the one required when the throughput of the 5G fronthaul connections is supported as a guaranteed service.