This paper introduces a novel algorithm for effective and accurate extraction of non-invasive fetal electrocardiogram (NI-fECG). In NI-fECG based monitoring, the useful signal is measured along with other signals generated by the pregnant women’s body, especially maternal electrocardiogram (mECG). These signals are more distinct in magnitude and overlap in time and frequency domains, making the fECG extraction extremely challenging. The proposed extraction method combines the Grey wolf algorithm (GWO) with sequential analysis (SA). This innovative combination, forming the GWO-SA method, optimises the parameters required to create a template that matches the mECG, which leads to an accurate elimination of the said signal from the input composite signal. The extraction system was tested on two databases consisting of real signals, namely, Labour and Pregnancy. The databases used to test the algorithms are available on a server at the generalist repositories (figshare) integrated with Matonia et al. (Sci Data 7(1):1–14, 2020). The results show that the proposed method extracts the fetal ECG signal with an outstanding efficacy. The efficacy of the results was evaluated based on accurate detection of the fQRS complexes. The parameters used to evaluate are as follows: accuracy (ACC), sensitivity (SE), positive predictive value (PPV), and F1 score. Due to the stochastic nature of the GWO algorithm, ten individual runs were performed for each record in the two databases to assure stability as well as repeatability. Using these parameters, for the Labour dataset, we achieved an average ACC of 94.60%, F1 of 96.82%, SE of 97.49%, and PPV of 98.96%. For the Pregnancy database, we achieved an average ACC of 95.66%, F1 of 97.44%, SE of 98.07%, and PPV of 97.44%. The obtained results show that the fHR related parameters were determined accurately for most of the records, outperforming the other state-of-the-art approaches. The poorer quality of certain signals have caused deviation from the estimated fHR for certain records in the databases. The proposed algorithm is compared with certain well established algorithms, and has proven to be accurate in its fECG extractions.