Psalm 109:25 describes the psalmist becoming an object of scorn; those who see him shake their heads in contempt. It belongs to the larger biblical portrait of a righteous sufferer publicly humiliated by enemies.
Matthew 27:39 records passersby at Jesus' crucifixion deriding Him and wagging their heads, closely resembling the imagery of Psalm 109:25 as well as Psalm 22:7. Matthew does not explicitly identify Psalm 109 here, so the connection is typological. The public ridicule experienced by the psalmist becomes part of the scriptural pattern reproduced at Calvary, where Jesus is mocked while apparently powerless.