Wrexham fell behind in the 17th minute when John Marquis' rasping drive got the better of goalkeeper Arthur Okonkwo. The visitors were behind for just six minutes, though, after Steven Fletcher headed in Ryan Barnett's pinpoint cross for his fifth goal in his last seven league games.
Oliver Rathbone spurned a glorious chance just before half time as his header from six yards out went well wide. The Welsh side had a disastrous start to the second half when Eoghan O'Connell clumsily brought down George Lloyd and Marquis scored from the rebound after Okonkwo saved his 48th-minute penalty.
Substitute Paul Mullin and Fletcher had efforts cleared off the line late on but it proved to be a night of frustration for Ryan Reynolds and Rob McElhenney's team who lost 2-1 in the cross-border derby.
Shrewsbury are still in the relegation spots but closed the gap to 20th-placed Bristol Rovers to five points. Wrexham, on the other hand, are third behind Wycombe Wanderers on goal difference and Birmingham City are two points clear, with have three games in hand.