Massive eruptions of OIB-type volcanism in the Leizhou-Hainan area, Indochina and South China Sea oceanic basin around the northwestern South China Sea margin indicate occurrence of strong deep hot mantle upwelling. However, when it started and how it influenced the northwestern South China margin is still unclear. The mantle upwelling not only caused rising of lithospheric temperature, but also produced basement dynamic uplift. Thus, we conduct detailed analysis of the Cenozoic time-varying residual subsidence by subtracting the predicted subsidence from the backstripped subsidence along a new seismic reflection line in the Qiongdongnan Basin in the northwestern South China Sea margin to study the dynamic uplift and deep mantle upwelling. For the first time, we give a method to calculate the subsidence-independent, time-varying strain rates constrained by the varying faults growth rates. Then we forward predict the basement subsidence with a basin- and lithosphere-scale coupled finite extension model, and accurately recover the backstripped subsidence with a modified technique of backstripping to eliminate the effects of later episodes of rifting on earlier sediment thickness. Results show no residual subsidence in 45-28.4 Ma. But after 28.4 Ma, negative residual subsidence occurred, reached and remained ca. -1000 m during 23-11.6 Ma, and reduced dramatically after 11.6 Ma. In the syn-rift period (45-23 Ma), the residual subsidence is ca. -1000 m indicating a significant subsidence deficit, however in the post-rift period (23-0 Ma), it is positive of ca. 300 to 1300 m increasing southeastwards denoting considerable subsidence excess. These results suggest that the syn-rift subsidence deficit commenced at 28.4 Ma, while the post-rift excess subsidence occurred after 11.6 Ma. Combined with previous studies, it is shown that the subsidence anomalies cannot be explained only by lithospheric deformation, such as depth-dependent lithospheric stretching, post-rifting crustal thinning, lower crust flow and magmatic intrusion. We infer that the opposite residual subsidence in the syn- and post-rift periods with similar large wavelengths (>102 km) and km-scale amplitudes are results of transient dynamic topography induced by deep mantle upwelling beneath the central Qiongdongnan Basin, which started to influence the margin at ca. 28.4 Ma, continued into the Middle Miocene, and decayed at ca. 11.6 Ma. The initial mantle upwelling had precipitated considerable continental extension and faulting in the Late Oligocene (28.4-23 Ma), however, prohibited the syn-rift basement subsidence. After ca. 11.6 Ma, vanish of mantle upwelling in the Qiongdongnan Basin yielded rapid post-rift subsidence, and meanwhile, the strong mantle upwelling probably migrated beneath the Leizhou-Hainan area to form huge basaltic lava flow.