How do you know whether or not you are praying a prayer from God? Sometimes our prayers don't get answered. But prayers that align with God's will, will be answered.
How do you know you are praying in the Spirit and not from the soul or the flesh? The word of God says we don't know how we ought to pray, but it's the Spirit that makes intercession for us (Romans 8:26). There is a call from God to pray in the Spirit (Jude 20, Ephesians 6:18).
Number two will help us discern whether or not we are praying in the Spirit
In the Garden of Gethsemane Jesus pleaded that His Father would not pour out His wrath upon Him at the cross, but Jesus said, "O My Father, if this cup cannot pass away from Me unless I drink it, Your will be done" (Matthew 26:42).
Now this is the confidence that we have in Him, that if we ask anything according to His will, He hears us (1 John 5:14). As long as it's according to God's will, He hears us.
There is power in the name of Jesus! "And in that day you will ask Me nothing. Most assuredly, I say to you, whatever you ask the Father in My name He will give you"
(John 16:23). When you ask in Jesus' name, He will give it to you.
We must pray in the Spirit with the Spirit, pray God's will, not our own, and pray in Jesus' name to see our prayers be answered.
"The effective, fervent prayer of a righteous man avails much" (James 5:16).