How can I repair the end of joists sitting in brick pockets?
Your approach does not seem safe or sane. Since this is a structural problem, if I were you, I would consult a structural engineer and not make a DIY job out of it. Consequences for doing this sort of job incorrectly include the collapse of the building and potential death of yourself or anyone else in it or in the vicinity.

The general approach for this sort of thing is to fasten a new load-bearing wall or column to the joist and chop off the rotten part at the brick face with a chainsaw. Needless to say, the details are heavily dependent on site conditions.