Solution: (thanks to @nemesv for the tip)
Programmatically add the target with
ConfigurationItemFactory.Default.Targets.RegisterDefinition(
"ApplicationInsightsTarget",
typeof(Microsoft.ApplicationInsights.NLogTarget.ApplicationInsightsTarget)
);
and use it with
<target name='ai' xsi:type='ApplicationInsightsTarget' />