The York skipper fired in from 35 yards to beat the Shrimps, who had earlier seen Paul Mullins’ opener cancelled out by a Stephane Zubar header.
Morecambe made a purposeful start to the game and forged ahead on 10 minutes through Mullin.
The 20-year-old striker converted from six yards after Aaron Wildig’s initial shot towards goal following a Padraig Amond left-wing raid.
York levelled, though, on 34 minutes when Zubar headed in from a yard following Luke Summerfield’s left-wing corner to the far post.
After Jake Hyde had seen a header cleared off the line by Shrimps sub Kevin Ellison, the Minstermen then forged ahead after 51 minutes in spectacular fashion.
Midfielder Penn claimed only his second goal of the season when he rattled a powerful long-range strike into Danny Ward’s top left-hand corner.