The narrowband Internet of Things (NB-IoT) is a cellular technology introduced by the third-generation partnership project (3GPP) to provide connectivity to a large number of low-cost Internet of Things (IoT) devices with strict energy consumption limitations. However, in an ultradense small cell network employing NB-IoT technology, intercell interference can be a problem, raising serious concerns regarding the performance of NB-IoT, particularly in uplink transmission. Thus, a power allocation method must be established to analyze uplink performance, control and predict intercell interference, and avoid excessive energy waste during transmission. Unfortunately, standard power allocation techniques become inappropriate as their computational complexity grows in an ultradense environment. Furthermore, the performance of NB-IoT is strongly dependent on the traffic generated by IoT devices. In order to tackle these challenges, we provide a consistent and distributed uplink power allocation solution under spatiotemporal fluctuation incorporating NB-IoT features, such as the number of repetitions and the data rate, as well as the IoT device’s energy budget, packet size, and traffic intensity, by leveraging stochastic geometry analysis and mean-field game (MFG) theory. The effectiveness of our approach is illustrated via extensive numerical analysis, and many insightful discussions are presented.