The Wales captain popped up in the dying minutes to slot home and cancel out Kevin De Bruyne's second-half opener to take the edge off what was a celebration for Belgium, with a place at the 2014 FIFA World Cup already secured.
The impressive result could help to ease some of the pressure on Wales boss Chris Coleman, whose future had been the subject of much discussion before the match.
Belgium boss Marc Wilmots named a strong side, despite having already wrapped up top spot in Group A, with Romelu Lukaku, Moussa Dembele and De Bruyne all handed starts.
Craig Bellamy was handed his final international appearance up front for the visitors, while Chris Gunter became the youngest Welshman to reach 50 international caps.
The visitors looked bright in the opening exchanges, with Bellamy, Simon Church and Ramsey linking well in the middle of the park.
But it was the hosts that carved out the first clear-cut opportunity after 20 minutes, as Lukaku raced away from James Collins to test goalkeeper Wayne Hennessey from a tight angle.
Wales had a chance of their own soon after as Ramsey exchanged a neat one-two with David Vaughan on the edge of the box, before skewing his shot harmlessly wide.
Belgium immediately responded and should have taken the lead when De Bruyne found himself on the end of a teasing Kevin Mirallas cross, but failed to find the target.
They were nearly ahead in spectacular circumstances 10 minutes later as Toby Alderweireld managed to flick the ball over Vaughan, before smashing a deflected volley off the bar.
Lukaku wasted another good chance just before the break, heading Mirallas' cross just wide.
The Everton striker caused more problems for the Wales defence within the first few minutes of the second half, powering into the box before firing over the bar.
Wilmots brought on Eden Hazard in an attempt to try to find a way through a tenacious visiting rearguard, who suffered a blow when Collins limped off after 55 minutes.
But it was Hazard's team-mate De Bruyne who finally broke the deadlock 10 minutes later, capitalising on a defensive error down the right before driving a low shot past the keeper.
It nearly got worse for Wales a couple of minutes later, with Hennessey forced to make a smart save to deny the impressive Mirallas.
Mirallas was denied by the Wolves keeper again 15 minutes from time, before Axel Witsel sent an acrobatic shot over the bar, as the hosts looked to added to their advantage.
Wales did manage to test Thibaut Courtois as the match began to wind down, the goalkeeper palming away a Sam Vokes' effort.
Harry Wilson came on for Hal Robson-Kanu to become the youngest player to appear for Wales, but it was veteran Bellamy who provided the moment of magic for Wales' equaliser, teeing up Ramsey in box for a cool finish with just two minutes left.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.