# How to replace a selected set of elements in a list?

This is a follow up on this. Based on the solution provided by @C.E. I can extract the elements around the center at any level. Now I want to replace the elements colored in red (selected).

So, in the shown example, the list of the selected elements is: {7, 4, 10, 6, 7, 1, 1, 1, 6, 3, 8, 0, 4, 6, 2, 7} and I wish to replace them by {6, 2, 1, 5, 0, 10, 2, 2, 3, 7, 9, 3, 3, 2, 8, 5}.

How can I do this?

pos[m_, {l1_, l2_}, dim_] := Position[CenterArray[

new = Thread[p -> {6, 2, 1, 5, 0, 10, 2, 2, 3, 7, 9, 3, 3, 2, 8, 5}]