Suppose I live in Ireland, and commute to Northern Ireland for work. Lots of people do this, as in more than every other EU border put together.
The tax treaty says that my employer deducts the relevant taxes from my salary applicable in Northern Ireland. I declare it on my Irish tax return as offshore income, and I can deduct the UK tax already paid from my Irish tax bill. If my employer only deducted NI, I wouldn't get any deduction at all from my Irish tax bill. Either way, I don't have to pay any Irish PRSI and the UK NI contributions count towards any Irish benefits I'm entitled to in the same way that deductions from an Irish employer would.