There are many passages that convey and support the understanding that oil is used biblically as a symbol for the Holy Spirit.
For instance, we read in Mark 6:13 that Christ had His disciples anoint sick people with oil, and they were healed. We know that Christ healed the sick with the power of the Holy Spirit (Luke 8:43-46 — the Authorized Version has here, “virtue,” but the literal meaning is, “power,” compare New King James Bible. Compare, too, Mark 5:30; Luke 6:19).
Christ gave His disciples the same ability to heal sick people by the power of the Holy Spirit (Mark 16:18), which presence is symbolized by the anointing of the sick person with oil (James 5:14).
Another example for this symbolism is found in the famous parable with the 10 virgins (Matthew 25:3, 4, 8). They all fell asleep, and the oil of the five foolish virgins was going out — that is, they were loosing more and more of the power of the Holy Spirit within them.
1 John 2:27 speaks of our anointing abiding in us. This is a clear reference to the Holy Spirit that had been promised by Jesus Christ (John 14:16; 16:13). In 2 Timothy 1:6, Paul admonishes Timothy to “stir up” — or to “re-kindle” — the gift of God, referring here to the Holy Spirit.
We also read that the Holy Spirit rested upon Christ (Isaiah 11:2). At the same time, we read that the Father anointed Christ with the “oil of gladness, more than” His “companions” (Hebrews 1:9) — as Christ had received the Holy Spirit not by measure (John 3:34, Authorized Version).
In addition, Samuel anointed Saul with oil (1 Samuel 10:1), and Saul received the Holy Spirit (verses 6-9). Later, Samuel anointed David with oil, and at that moment, David received the Holy Spirit (1 Samuel 16:13). In Psalm 89:20, it is emphasized that God had found His servant David, whom He anointed with His holy oil. (Compare also Psalm 23:5). As God’s servant, David would have obeyed God before his anointing to an extent. We are reminded of Acts 5:32, telling us that God gives His Holy Spirit only to those who are already obeying Him to a degree.
God also explains to us in Isaiah 61:3, that those who will be converted in the Millennium and receive the Holy Spirit, will receive “the oil of joy” — since the Holy Spirit is a Spirit of joy (Galatians 5:22; Acts 13:52).
In a more general sense, the Bible uses the word “oil” to symbolize God’s presence (We read in Genesis 28:18-19 that Jacob poured oil on the pillar stone, calling the name of the place “Bethel.” Jacob understood that God was present). “Oil” can also symbolize a consecration, or a special setting apart for a holy purpose. “Oil,” then, can refer to the Holy Spirit abiding in a person, or it can also refer to God’s presence, through His Spirit, to motivate, guide or lead a person, although the Holy Spirit might not reside in the person. When Moses was instructed by God to anoint Aaron and his sons into the office of priest, thereby using the “anointing oil” (Leviticus 8:2, 30; compare regarding the anointing oil, Exodus 30:22-33), they were set apart or consecrated for God’s holy purpose (But not many of Aaron’s descendants did actually have the Holy Spirit within them). In addition, God required the use of oil to symbolize His involvement in the consecration of the leadership of the nations of ancient Israel and Judah (although God’s Holy Spirit would only reside within a very few of the national kings at that time).