Hook menu allowed items to specify a theme callback which is called to determine the used theme.
$items['system/ajax'] = array(
'title' => 'AHAH callback',
'page callback' => 'ajax_form_callback',
'access callback' => TRUE,
'theme callback' => 'ajax_base_page_theme',
'type' => MENU_CALLBACK,
'file path' => 'core/includes',
'file' => 'form.inc',
);
This has to happen somehow early in the request (before the actual _controller is called. It could be a method defined on the route or simply something manually called in your controller, though this feels wrong.