As shown in Acts 8.14-16 and Acts 19.1-6 the Samaritans and the Ephesians believed but still had not received the Holy Spirit until the apostles laid hands on them.
Further Thomas called Jesus: “My Lord and my God”[1] but did not receive the Holy Spirit until later on the day of Pentecost.
A closer look at 1 Corinthians 12.3 will show that it is not about a believer receiving the Holy Spirit who indwells him but being stirred by the Holy Spirit to do a certain thing – in this case to utter “Jesus is Lord”: Therefore I want you to understand that no one speaking in the Spirit of God ever says “Jesus is accursed!” and no one can say “Jesus is Lord” except in the Holy Spirit. The Holy Spirit can stir anyone, even an unbeliever, to do a certain thing but that does not mean that he has received the Holy Spirit who indwells him. For example, the Holy Spirit stirred, Cyrus the Persian king to utter that YHWH is the God of heaven, and to allow the Jews to return to Jerusalem to rebuild the temple:Now in the first year of Cyrus king of Persia, that the word of YHWH by the mouth of Jeremiah might be fulfilled, YHWH stirred up the spirit of Cyrus king of Persia, so that he made a proclamation throughout all his kingdom and also put it in writing: “Thus says Cyrus king of Persia, ‘YHWH, the God of heaven, has given me all the kingdoms of the earth, and he has charged me to build him a house at Jerusalem, which is in Judah. Whoever is among you of all his people, may YHWH his God be with him. Let him go up.’” None will seriously suggest that Cyrus has received the indwelling Holy Spirit.
[1] Jn 20.28.