I disagree with @ISpeakAlien (but welcome any counter-example you may have!)
In english, you can say "what pencil do you want?" but the more proper word here is "which." You already know the person wants a pencil and you use "which" to clarify the type or kind of pencil. Where in English these words are, in some cases like this one, interchangeable, in Swahili they are not.
I think I can agree with you on that.
What I would say, per your initial comment, is that in all cases you can translate "gani" to "which," and in all cases you can translate "nini" to "what," but there are only a select few cases where "gani" can also be translated to "what." And I would argue that in those select few cases, "which" would probably be a more accurate translation anyway.
Do you agree with me on that? If not, do you have some counter-examples?