This is a really simple change here. $1, and friends are appointed only after the match is successful, and not during the match itself. If you want to use immediate values, do the following:
s = "02112016"
s.sub(/(\d{2})(\d{2})(\d{4})/, '\1-\2-\3')
\1 , $1. , gsub, $1 , \1 .