No, before the whole render section, i.e. it has to include the clear() and everything. Set it first, do the usual stuff as you would do it when rendering directly to screen, remove it and render the scene one again, but now with the correct camera view.