The NKJV footnotes the first phrase with a literal rendering that connects it to several other verses in the book.
Quick answer
Contempt for a neighbor is a failure of sense, not a sign of discernment. The wise alternative here is silence.
Read both lines
The NKJV footnotes "devoid of wisdom" as literally lacks heart, which is the same idiom used of the adulterer at 6:32 and the young man walking to the wrong house at 7:7. Putting neighbor-contempt in that company is a strong move: sneering at people is filed with the failures of judgment that wreck a life, not with the sharpness of someone who sees clearly. The second line's answer is restraint rather than a better opinion. A person with understanding may well have a view and simply declines to broadcast it, which the book treats as the harder and wiser thing.
Related: Proverbs 6:32 · Proverbs 7:7 · Proverbs 17:28 · Proverbs 10:19
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.