The midfielder converted his spot kick successfully to cancel out Ivan Trickovski's opener.
Wales manager Chris Coleman opted to leave Gareth Bale on the bench for the game and it was the hosts who dominated the opening exchanges, with Trifun Kostovski nearly converting Darko Tasevski's cross.
The visitors responded when Jonny Williams was played in on goal by Joe Ledley, but he was denied by goalkeeper Tomislav Pacovski.
Macedonia took the lead on 20 minutes when a free kick deflected into the path of Trickovski, who fired the ball beyond Boaz Myhill from close range.
Craig Bellamy almost found an equaliser with a free kick from 25 yards, but his effort hit the woodwork.
Wales were given opportunity to level the scores six minutes before the break when Ramsey was brought down in the area by Pacovski, and the Arsenal man made no mistake from 12 yards, placing his effort beyond the goalkeeper.