We present an inversion technique based on the Marquardt algorithm to estimate the depth of a 2.5-D sedimentary basin in addition to the regional gravity anomaly that is associated with the residual gravity anomaly, wherein the density contrast varies parabolically with depth. Forward modeling is carried out through a derived analytical gravity expression of a 2.5-D vertical prism. Inversion of a theoretical gravity anomaly with and without a regional gravity anomaly illustrates the procedure that it is found to be insensitive to the regional gravity effect. Furthermore, the algorithm is exemplified with the gravity anomalies of the derived density-depth model of the Godavari subbasin, India with a parabolic density profile resulting in a more consistent geological model rather than a constant density profile. The main advantage of this method is that it works well even when the profile of interpretation does not bisect the strike length of the sedimentary basin.