You can use "forloop.parentloop" to get to the outer forloop, so in your case "{{forloop.parentloop.counter}}".