This research paper proposed an architecture and simulation-based performance evaluation of the 5G-based smart city Internet-of-Things (IoT) network, which consists of multi-access edge computing (MEC). This smart IoT framework was designed and evaluated with the help of the Simu5G network simulator software. In this architecture, the IoT device sensor layer refers to the smart traffic lights, environment sensors, and energy meters provided in the NED files. These form the sensing layer of the IoT network stack, which helps in capturing real-world information in terms of temperature, CO2 concentration, and density of network traffic, etc. The communication-layer serves as the core network, comprising the gNodeB, MEC Servers, and the 5G New Radio (NR) core, providing connectivity for sending and receiving low-latency, highly reliable sensor data. The applications layer provides smart city services, simulating how IoT devices send data to application servers that control traffic or manage energy consumption. The above configurations emulate the behavior of IoT devices’ sensor layer, while the output reveals how effectively IoT devices can be serviced by a 5G network under various traffic conditions. The experimental procedure includes the configuration of network topologies, traffic patterns, the movement of the IoT devices, and the collection of performance metrics for different traffic loads and network node density. A customized sensor application program was developed using the C++ language to implement smart city environmental monitoring and other smart infrastructure services. The experimental results prove that the integration of MEC within a 5G-based smart-city IoT network can improve the network reaction time, reduce communication delay, alleviate the backhaul traffic congestion, and increase service reliability compared to the traditional cloud-based service. The proposed framework can be used as a scalable platform for further investigation of future smart-city applications, including autonomous transportation systems and pollution control in the future 6G smart cities.