Question: In Genesis:44:5, did Joseph use divination? If so, was this divination godly, or was it a sin?
Response: In Genesis:44:4-5, Joseph told his servant to follow after his brothers and, upon exposing the hidden cup, to ask, "Is not this it in which my lord drinketh, and whereby indeed he divineth?" Then, in verse 15 we read, "And Joseph said unto them, What deed is this that ye have done? [Know] ye not that such a man as I can certainly divine?"
We don't believe that Joseph was actually saying that he practiced divination. We need to remember that he had not revealed his identity to his brothers and they regarded him simply as an Egyptian official who had the power of life and death over them. Furthermore, Joseph had also manipulated events in order to "frame" his brother Benjamin. We know that Joseph led an exemplary life before the Lord during his time in Egypt. Consequently, the "frame" was something that he was doing specifically in order to serve a certain purpose. It didn't reflect the conduct of his life in anything else.
Therefore, these verses don't indicate that Joseph used occult divination at all; they merely record what Joseph told his steward to say to his brothers upon overtaking them on their journey home. From what we know of Joseph, according to the Scriptures we cannot imagine that this man who had said that "interpretations belong to God" (Gn 40:8, 41:16) could possibly engage in this occult practice.
His brothers' response is also interesting in that they give no credence to the pagan practice of divination, but instead Judah says, "What shall we say unto my lord? what shall we speak? or how shall we clear ourselves? God has found out the iniquity of thy servants: behold, we are my lord's servants, both we, and he also with whom the cup is found" (44:16).
Joseph himself says nothing further about divination, but states, "...God forbid that I should do so: but the man in whose hand the cup is found, he shall be my servant; and as for you, get you up in peace unto your father."
The larger question here could be "why did Joseph use deception to determine his brothers' loyalty?" After suffering treachery and deceit at the hands of his family in the past, this was an effective means of doing so. Furthermore, it wasn't done with malicious intent or secret glee for trickery's sake but rather for the purpose of proving their hearts in order to accomplish redemption and restoration. Among many other types of Christ seen in the life and trials of Joseph, his temporary "deception" of his brothers may be compared to the Lord's veiling of His identity from the two disciples on the road to Emmaus as a means of searching out their hearts and minds. And just as Joseph began to reveal himself to his brothers at a meal, Jesus revealed himself in the breaking of bread after His resurrection: "And their eyes were opened, and they knew him; and he vanished out of their sight. And they said one to another, Did not our heart burn within us, while he talked with us by the way, and while he opened to us the scriptures?" (Lk 24:30-32). Isn't it likely that the hearts of Joseph's brothers "burned within them" when he arranged them at his table in order of birth (Gn 43:33)?