Stanley grabbed a deserved equaliser after 29 minutes. Morecambe goalkeeper Barry Roche denied Michael Symes from close range but the ball ran loose for Bobby Grant to blast home.
The visitors regained the lead nine minutes after the interval when a Craig Stanley free-kick was touched on by Artell for his second goal of the match and third of the season.
But Grant then doubled his tally with a curled free-kick from the edge of the area, his 15th goal of the season.
Roche pulled off superb saves to deny Symes and Luke Joyce but with seven minutes remaining Ryan latched onto a looping ball on the edge of the area and fired in.