Wrexham went 2-0 down just 36 minutes into the match at Racecourse Ground but pulled a goal back through Elliott Lee just before the break.
The home team pushed for the equaliser but were left frustrated for much of the second half until substitutes Steven Fletcher and Jordan Davies intervened.
Scottish striker Fletcher smashed in the equaliser in the 87th minute to seemingly secure a point, but less than two minutes later Davies popped up with a late winner.