Parcly Taxel has already given a good answer for your specific question, but, since your title also said "understanding why", let me explain a way to think about this. The following idea works in general to prove Sylvester's $ab-a-b$ result, but I'll describe it in your specific situation.
Think of the positive integers in blocks of 5 consecutive numbers. In the first block $\{1,2,3,4,5\}$, the only payable amount is the last element, 5. As a result, in all subsequent blocks, the last element will be payable, just by using more 5-coins. In the second block, $\{6,7,8,9,10\}$, you get, in addition to the last element 10 that we already know is payable, one more payable element, 7. As a result, in all subsequent blocks, the second element will be payable, just by using more 5-coins. In the third block, $\{11,12,13,14,15\}$, in addition to the second and last elements that we already know are payable, we get one more payable element, 14. So in all later blocks, the second, fourth, and last elements will be payable. The fourth block gets us no new payable elements (because there's no multiple of 7 in that block), but the fifth block gets us the new payable element 21. So in all subsequent blocks, all elements but the third will be payable. In the 6th block, we get the new payable number 28, the third number in that block. So from the sixth block on, everything is payable. The last block with an unpayable element is therefore the fifth block, and its only unpayable element is the third element, 23.
You might check what happens in the analogous calculation with blocks of 7 instead of blocks of 5. You'll find that sometimes a block gets two new payable elements, which didn't happen with blocks of 5, but the process still leads you to the correct answer 23.