The requirement of high data rates, low latency, efficient use of spectrum and coexistence of different network technologies are major considerations in Internet of Things (IoT) based Fifth Generation (5G) networks. To achieve the above requirements, the incorporation of Artificial Intelligence (AI) is required to make efficient decisions based on the massive data generated by the large number of IoT devices. AI methods analyse the data to extract the patterns and make sense of the data to prescribe action to the end devices. In this work, we first give an overview, discussing the challenges and relevant solutions of the 5G and IoT technologies including the IoT based 5G enabling technologies. Second, we discuss the need for AI in future IoT based 5G networks in the perspective of Kipling's method. In addition, we review the intelligent use of spectrum through full duplex and cognitive radio technologies.