In this study, we investigate the tectonic and stratigraphic evolution of the northern Tanzania margin (western Indian Ocean) to provide new insights on the structural drivers governing the formation of Zanzibar and Pemba islands. Using 2D seismic reflection profiles and exploration wells, we have reconstructed the evolution of the submarine drainage network throughout the last 30 Myr, from the Oligocene to recent times, providing a tape-recorder with which we determine the different tectonic events that led to the eventual subaerial exposure of the islands. In detail, we observe a decrease in the number of slope canyon-channel systems during the lower-middle Miocene offshore Pemba Island that we interpret to represent the initial uplift of the island: tectonic deformation of the seafloor impeded up-dip to down-dip sediment transfer, forcing the abandonment of canyon-channel systems. At the same time, submarine canyons were still active offshore Zanzibar Island, located ~35 km south of Pemba, indicating that its uplift occurred later, likely during the upper Miocene to lower Pliocene. The uplift of the islands increased the slope gradient and promoted the formation of two newly discovered giant canyons that represent the main feeder systems to this sector of the western Indian Ocean since the Miocene. We propose a new conceptual model for the post-Oligocene evolution of the area, highlighting the main tectonic structures and their timing of formation. In this model, the onset of the anticlines of Pemba and Zanzibar islands resulted from tectonic inversion probably originated during the Oligocene-lower Miocene due to reactivation of Mesozoic-aged rift faults. This compressional phase is followed by the establishment of an extensional tectonic regime which promoted the subaerial exposure of the islands since the middle Miocene. Extensional faults, which dissect the post-Oligocene stratigraphy, create horsts and grabens on a variety of scales, such as Zanzibar and Pemba troughs. These grabens show comparative size and orientation to onshore rift basins, which may indicate a relation with the tectonics of the East African Rift System. Our results provide new insights on the evolution of one the least explored, though fascinating, continental margin settings worldwide that can support future source-to-sink investigations in the region.