As fast-emerging two-dimensional (2D) materials, MXenes have attracted great attention in the fields of optics and electricity. In this paper, the nonlinear optical (NLO) properties of the 2D MXene material (Nb4C3) and its MAX predecessor (Nb4AlC3) are presented. Also, the broadband NLO responses of Nb4AlC3 and Nb4C3 nanosheets had been investigated using the open aperture (OA) Z-scan technique. The results showed that 2D Nb4AlC3 exhibited significant two-photon absorption (TPA) properties in the short-wave infrared (SWIR) band. Different from Nb4AlC3, its etching residue, Nb4C3, exhibited totally opposite NLO behavior, which showed superior TPA properties in the ultraviolet (UV) band. This implied that the optical limiting (OL) properties of these two materials were exactly opposite. In the future, 2D Nb4AlC3 and Nb4C3 will be expected to be used as OL materials in the UV and SWIR bands, respectively, for such applications as laser protection, human eye protection, making optical filters, etc. Our work expanded a great potential application of 2D MXenes materials in the broadband nonlinear optical photonics.