5G, the fifth generation of wireless technology, has a significant impact on networking, enable faster data transfer speeds, lower latency, higher capacity, and greater reliability. An instantaneous response time is crucial for applications like real-time gaming, autonomous vehicles, remote surgery, and Internet of Things (IoT) devices that require rapid data processing. 5G introduces network slicing, which allows network resources to be divided into multiple virtual networks. 5G also allows network operators to dynamically allocate resources, adapt to changing demands, and introduce new services more efficiently in various fields. One of the major fields is internet of vehicles (IoV) which is a decentralized network. However, an increase in the number of requests on the network can result in delays, leading to high latency and low throughput. High network traffic may cause network congestion, which reduces the efficiency and effectiveness of the network. The proposed work focuses on adopting a network slicing-based strategy to mitigate network congestion in IoV networks for congestion free network. The proposed mechanism defines four network slices. The results show that the slicing approach provides better performance compared to the current access scheme and efficiently control network congestion. The slicing approach results in lower packet loss ratio and delay. The proposed approach is a stone towards the implementation of network slicing in Internet of Vehicles networks in the future for achieving improved performance, congestion control, energy efficiency, and spectrum utilization in IoV environments.