窮鼠猫を噛む(きゅうそねこをかむ)

Japanese vocabulary

Meaning: a cornered rat will bite a cat; despair gives courage to a coward

See it used in real works