The striker has made 41 appearances for the Dynamo and scored 14 goals since joining the club from Kimberley Miners Welfare last season.
Commenting on the new signing, first-team manager Brad Munn said: “I am thrilled to get James through the door finally after seasons of trying to work with him.
“His eye for goal and willingness to stretch teams is something that is going to add to our attacking options.”
A former Blue, Shaw has made over 70 first-team appearances for Long Eaton United since his debut against AFC Wulfrunians at the end of the 2017/18 season.
On the forward’s return to the Family Only Stadium, Munn added: “James is someone that is certainly known at our club and I’m sure it feels almost like a homecoming.
“We are looking forward to James pulling on the shirt once again a few years later on in his development and exciting everyone involved.
“Very happy to have you with us and welcome back Shawy!”