The spirit of Elijah is the spirit or power that God gave him and it is not his own human spirit.
Similarly, John the Baptist obtains a similar spirit or power from God while he was in his mother’s womb.
This spirit or power was to perform ‘similar’ acts as Elijah.
These acts of Elijah were to call the house of Israel (Northern Kingdom) to repentance and to know the true God. The days of Elijah were in turmoil. Elijah prepares the way for Elisha who performed miracles as did Elijah. The Northern Kingdom would fall within 100 years of his preaching because of their unbelief.
Similarly, John the Baptist preached the gospel to bring Judea (including the descendants of Jacob) and to prepare and declare the person of their salvation. He preached in turmoil times as well. As we know because of their unbelief, Judea was ruined and over 1 million people died (66-70 AD).
So Elijah was the same type and ‘similar' spirit as John the Baptist. And Elisha possessed a ‘similar’ spirit as Jesus the Christ.
Elisha has more power from God that any human being at that time of Elijah.
So when Jesus said the John the Baptism is the Elijah, he meant that John the Baptist performed similar acts, in the spirit and purpose of God, as Elijah.
In Christ, Always