It’s OP - I finally remembered it!
Ex-Libris by Ross King
The masquerade bit was from another / similar Ross King novel, Domino.
I have no idea why, but I woke up this morning thinking that the title of the book was Domino. Quick google search led me to the answer!