Ged Garner put the hosts ahead after just four minutes before James McClean levelled proceedings.
The Shrimps had Max Melbourne sent off before Paul Mullin notched his 17th goal of the season from the penalty spot following a handball.
Substitute Steven Fletcher capped off a fine away performance with his eighth goal of the season late on.
Victory means Wrexham stay third with just 10 league matches left to play this season.
Morecambe sit 10th, one point adrift of the play-off places.
“They’re (Morecambe) a team in form and fancy their chances of getting into the play-offs. It’s a bad start for us and it took us a little while to get going but as the second half wore on we got better and better.
“We needed to scrap out a result in those conditions and I felt we did that really well today.
“I’m very pleased with the professionalism of the team today. We’ve come through it with a great win.”
Marcus Smith follows in the footsteps of Jonny Wilkinson and George Ford as the latest English fly-half to write his name in drop-goal folklore.
Wilkinson delivered the biggest prize of all during the 2003 World Cup final and Ford’s masterclass saw off Argentina at last year’s tournament in France, while Smith’s boot ended Ireland’s dream of historic back-to-back Six Nations Grand Slams.
Smith came off the bench to mark his return from injury with a last-gasp clip over the posts to hand England a stunning victory – and afterwards namechecked both Ford and England kicking coach Kevin Sinfield.