Updated Diagram
Following is the position when West is about to lead the last spade (five cards remain, declarer has won four tricks and lost four):

Your nine of diamonds forces declarer to over-ruff with the Queen, and now your side gets two trump tricks rather than one (both partner’s Jack of trumps and your remaining ten of trumps are winners); EW finish with six tricks (declarer is down one in two diamonds).
Minus 90 scores 38%; plus 50 scores 88%. You did well to ruff; the textbooks call this play an ‘uppercut’.
The full deal appears on the next page