Non-invasive fetal electrocardiogram (FECG) is used to monitor the electrical pulse of the fetal heart. Decomposing the FECG signal from maternal ECG (MECG) is a challenging problem due to the low amplitude of FECG, the overlap of R waves, and the potential exposure to noise from different sources. Traditional decomposition techniques, such as adaptive filters, require tuning, alignment, or pre-configuration, such as modeling the noise or desired signal. In this paper, a modified Cycle Generative Adversarial Network (CycleGAN) is introduced to map signal domains efficiently. The high correlation between maternal and fetal ECG parts decreases the performance of convolution layers. Therefore, masking attention layer which is inspired by the latent vector is implemented to improve generators. Three available datasets from the Physionet, including A&D FECG, NI-FECG and NI-FECG challenge, and one synthetic dataset using FECGSYN toolbox are used for evaluating the performance. The proposed method could map abdominal MECG to scalp FECG with an average 97.2% R-Square [CI 95%: 97.1, 97.2] and 7.8 +- 1.9 [CI 95% 6.13-9.47] Wavelet Energy based Diagnostic Distortion on A&D FECG dataset. Moreover, it achieved 99.4% [CI 95%: 97.8, 99.6], 99.3% [CI 95%: 97.5, 99.5] and 97.2% [CI 95%:93.3%, 97.1%] F1-score for QRS detection in A&D FECG, NI-FECG and NI-FECG challenge datasets, respectively. Finally, the generated synthetic dataset is used for investigating the effect of maternal and fetal heart rates on the proposed method. These results are comparable to the-state-of-the-art and has thus a potential of being a new algorithm for FECG extraction.