Hi Gautam,
If the form inside the iFrame submits and calls a Mendix Published REST API, you can use a microflow timer or nanoflow polling mechanism in the parent Mendix page to check if the backend has received the data. Once the data is received, you can set a flag in a helper entity (e.g., isSubmitted = true), and based on this, hide the iFrame and show a container with the success message.
hope it helps!