Vine’s dictionary tells us the meaning of this word in this sentence.
“The sentient element in man, that by which he perceives, reflects, feels and desires."
It means the inner self, the heart.
To worship in spirit means to worship him from our heart. Not going through the motions, but truly having our heart (feelings emotions) engaged as we worship.
In other words, it’s not only the physical acts that we do in worship (raising hands, clapping, etc) by themselves. It has to be first from our hearts that result in the outward demonstrations.
The A/G Fire Bible commentary says it this way:
God’s primary concern is our spiritual attitude. “In spirit” points to the level or depth at which true worship occurs. Authentic worship must come from the heart. It should reflect a godly character and a deep devotion to God. Above all, our worship must focus on God’s character and attributes and be a heartfelt expression of one’s own spirit to God’s Spirit.
In other words, it is possible to do everything outwardly that seems like true worship, even things that we know God requires, but if our heart isn’t in it, it’s not worship.