Technically, the meaning of the sentence is ambiguous without knowing the wider context. You are correct that "on the subject" could link to "impart" or to "wisdom". However, the more likely scenario is that it is an adjective modifying "wisdom". The other interpretation implies that there is some person who is a "subject" being given wisdom. "Subject" is usually only used in this sense to refer to experimental subjects. There is nothing else in the sentence that would suggest this context, so it does not seem likely, whereas "wisdom on the subject" is a very common phrase. Assuming that this is the intended meaning, a less ambiguous version of the sentence would have been:
I was rather quiet as I didn't feel I had much wisdom on the subject to impart.
Your rephrased sentence carries only the adverbial meaning, because now "on the subject" is part of the relative clause beginning with "which" instead of simply being a prepositional phrase following an infinitive. One could argue that there is still some ambiguity, but I cannot imagine a native speaker forming the sentence in this way if they intended the adjectival meaning.
Also, your rephrased sentence should use "could" rather than "can". The imparting of wisdom is a hypothetical situation (because the person is remaining quiet) and should use the conditional "could".
(As a side note, style guidelines often suggest using "that" with restrictive relative clauses and "which" with nonrestrictive relative clauses. This is not a grammar rule, but it is a convention that is taught at least in the USA. Your clause is restrictive, because it is not offset by a comma, so I would recommend using "that".)
Your shorter paraphrased version is still somewhat ambiguous for the same reasons as above, although I think "on the subject" is more clearly adjectival in this case, because it immediately follows "knowledge".