I've never thought of doing it quite thqt way.....there are steel "masonry boxes" intended for this use, and they just happen to be sized to fit in with the brickwork.

The way your request is worded, it seems you plan to use NMC (Romex). Masonry is generally considered a 'wet' location, and you should use UF instead. However it's done, the wire should be secured to the box with the appropriate cable clamp.