First, you can simplify the trigger like I do below with:
(.*\n){5}
This makes it more obvious that we want exactly five of the extra lines.
Next, in Lua you can have multi-line literals, so this will work:
<triggers>
<trigger
enabled="y"
lines_to_match="6"
match="^whatever matches first line\n(.*\n){5}\z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Note [[%0]]</send>
</trigger>
</triggers>
The sequence [[ something ]] is a multi-line literal, which can include linebreaks.
An alternative, if you don't want to use Lua (for some reason hehe), is to call a script, like this (in VBscript):
sub mytrigger (name, line, wildcards)
Note wildcards (10)
end sub
Now the issue of newlines within a quote goes away as this is a variable, not a quoted string.