The gifts of the spirit are manifestations of the Holy Ghost intended to fill the saints. They are a completely different thing than talents, which are shared by member and nonmember alike.
I suppose no one is surprised that the capitol of Austria is located in the Austria or that the President of Russia is Russian. So why should it be such a foreign idea that the gifts of the spirit come by the spirit? They are gifts, and they are given by the spirit. What could be more plain?
That means that the gifts of the spirit come by and require the Holy Ghost. They are manifestations of the Holy Ghost, and are therefore only given to one who has the Holy Ghost. The gifts of the spirit are the sole domain of members of the church, as members of the true church are the only people with the gift of the Holy Ghost.
Joseph Smith taught "We believe in the gift of the Holy Ghost being enjoyed now, as much as it was in the Apostles' days; we believe that it [the gift of the Holy Ghost] is necessary to make and to organize the Priesthood, that no man can be called to fill any office in the ministry without it; we also believe in prophecy, in tongues, in visions, and in revelations, in gifts, and in healings; and that these things cannot be enjoyed without the gift of the Holy Ghost." (TPJS page 243)
Note that statement: "we also believe in prophecy, in tongues, in visions, and in revelations, in gifts, and in healings; and that these things cannot be enjoyed without the gift of the Holy Ghost."
So the gifts of the spirit are exactly what they sound like. Gifts. Of the Spirit.
In fact, Joseph Smith also called them "gifts of the Holy Ghost" when he said "These, then, are all gifts; they come from God; they are of God; they are all the gifts of the Holy Ghost; they are what Christ ascended into heaven to impart" (TPJS 245).
Thus the gifts of the spirit are a completely different thing than talents. The ability to paint, sing, or play piano well are not gifts of the spirit.
One can be a very talented teacher, but without the gift of the Holy Ghost, one does not have the spiritual gift which the scriptures call the gift to teach. That is necessarily so because gifts of the spirit are always manifestations of the Holy Ghost, and without the gift of the Holy Ghost there can be no such manifestations. Indeed, a "dynamic" or charismatic teacher is rarely, if ever, the one found teaching the truth powerfully by the gift of the Holy Ghost.
One can be wise about many things, but unless it is the wisdom whispered by the Holy Ghost that bears no relationship to the "gift of wisdom" spoken of in the scriptures. Indeed, wisdom about worldly things may strongly disagree with God's own wisdom as delivered by his spirit to man.
Moroni 10:8 And again, I exhort you, my brethren, that ye deny not the gifts of God, for they are many; and they come from the same God. And there are different ways that these gifts are administered; but it is the same God who worketh all in all; and they are given by the manifestations of the Spirit of God unto men, to profit them.
Joseph Smith also explained that the gifts of the spirit play an essential role in the gospel:
"But, said Mr. Sollars, 'May I not repent and be baptized, and not pay any attention to dreams, visions, and other gifts of the Spirit?' I replied: 'Suppose I am traveling and am hungry, and meet with a man and tell him I am hungry, and he tells me to go yonder, there is a house of entertainment, go and knock, and you must conform to all the rules of the house, or you cannot satisfy your hunger; knock, call for food, sit down and eat;--and I go and knock, and ask for food, and sit down to the table, but do not eat, shall I satisfy my hunger? No. I must eat. The gifts are the food; and the graces of the Spirit are the gifts of the Spirit.'"
The question that prompted this statement was whether one couldn't repent, and be baptized, and not pay attention to dreams, visions, and other gifts of the spirit. And the prophet's answer is perfect. We cannot satisfy our hunger without eating, and the gifts are the food.