Whoever bought you the very generous gift wil have to contact the store who sold them the TV and ask for the PIN code. They will need to provide proof of purchase unless the salesman remembers them. Even to request a mastercode you will need proof of purchase, and will need to cntact the dealer who made the sale.
No other dealer will assist you without a copy of the invoice from the original supplying dealer.
I sold a TV on ebay once and forgot to send the PIN. The buyers local dealer wouldn't help him at all and rightly so as it's a system which is implemented to stop the equipment falling into the hands of people who haven't acquired it lawfully.
Just ask the buyer to contact the dealer he bought it from and they will supply the code no problem. There is no other solution to make the system useable for obvious reasons.