Code:
$
$ cat data_1.txt
"8955719","186497034","0001","M","3"
"8955719","186497034","0002","M","10"
"8955719","186497034","0003","M","10"
"8955719","186497034","0004","M","3"
"8955723","186499034","0001","M","3"
"8955723","186499034","0002","M","10"
"8955723","186499034","0003","M","10"
"8955723","186499034","0004","M","3"
"8955723","186499034","0004","M","1234"
"8955723","186499034","0004","M","12345"
"8955723","186499034","0004","M","123456"
"8955723","186499034","0004","M","1234567"
$
$ perl -F, -lane 'BEGIN{$,=","} $F[4] =~ s/(")(\d+)(")/$1.sprintf("%04d",$2).$3/eg; print @F' data_1.txt
"8955719","186497034","0001","M","0003"
"8955719","186497034","0002","M","0010"
"8955719","186497034","0003","M","0010"
"8955719","186497034","0004","M","0003"
"8955723","186499034","0001","M","0003"
"8955723","186499034","0002","M","0010"
"8955723","186499034","0003","M","0010"
"8955723","186499034","0004","M","0003"
"8955723","186499034","0004","M","1234"
"8955723","186499034","0004","M","12345"
"8955723","186499034","0004","M","123456"
"8955723","186499034","0004","M","1234567"
$
$