Neat hand.
I think that S should have a reasonably good idea of the layout by trick 4, confirmed by trick 5.
He may not know if East is 1=5=2=5 or 1=5=3=4, and he won't know about the diamond J, but he should know about where the diamond Q is located, which gives him a chance to look brilliant.
He can duck the diamond towards dummy, and throw the diamond Ace on the spade K.
Now, if declarer exits a diamond, N has to win the Q (I mean, how can he duck on that defence?), and it is trivial for him to exit his last club.
We can see that N could have saved the game by giving a ruff at trick 2, but that is being double-dummy imo. We can see that N can save the game by going in with the diamond Q on the low from dummy, and exiting a club, and that seems easy enough. I can't readily construct a layout on which it is wrong to pop the Queen after declarer threw a diamond on the top spade.
It isn't very often that one gets to duck an Ace and then throw it away.
On balance, it seems to me that rising with the diamond Queen at trick 9, as the play went, is easier to find than the duck of the Ace followed by throwing it away, so I have to give most of the blame to N.
Btw, I think that even if declarer is 1=5=2=5, S can defend this way, since even tho declarer gets to jilt his second diamond, he has to then concede a club, and we tap him with our now penultimate diamond, and he has to yield a second club before his long card is good and we score our last diamond....which could, if everyone cooperated, be the beer card
However, that requires declarer to unblock dummy's 8, and partner to play his part as well.
'one of the great markers of the advance of human kindness is the howls you will hear from the Men of God' Johann Hari