The match saw Gary Speed claim his first win as Wales manager, while Northern Ireland ended up with the wooden spoon at the Aviva Stadium.
Ramsey netted his third international goal, before Earnshaw came off the bench to put the low-key match beyond Nigel Worthington’s men.
The loss meant Northern Ireland ended the tournament without a single point or even a goal, while conceding 10 over the three games.
Both nations headed into Friday night’s match knowing the silverware was beyond their grasp and the stadium was near empty, with neutral fans – gaining free entry after paying for tickets for previous matches – outnumbering those supporting the Welsh and Northern Ireland.
Ramsey returned as captain for Wales after being rested for Wednesday’s game against Scotland while fit-again Craig Bellamy also featured in a stronger line-up.
Northern Ireland made five changes from the side thrashed 5-0 by the Republic of Ireland, bringing in Jonny Tuffey, Colin Coates, Oliver Norwood, Robert Garrett and Niall McGinn.
For those fans who did make the effort to attend the match at the Aviva Stadium, there was little in the way of entertainment early on.
Wales carved out a half-chance when David Vaughan slipped the ball into the path of Steve Morison but his finish was weak and Tuffey was able to gather in the Northern Ireland goal.
The Irish then had a go when McGinn twice saw efforts cannon off the body of Danny Gabbidon, who was winning his first cap since November 2009, following good work from Jonny Gorman.
The best chance so far fell to Speed’s men when Bellamy nodded down for Ramsey and all he had to do was stab home into a gaping net but Gareth McAuley did enough to prevent him grabbing the opener.
Wayne Hennessey was then called into action when McGinn unleashed a stinging shot from the edge of the area that was blocked well by the goalkeeper.
Wales had the chance to pile on the pressure when McAuley fouled Jack Collison just outside the box and Bellamy presided over the free-kick. But he lofted a poor effort over the crossbar, with Tuffey untroubled by the set-piece.
The breakthrough came after 36 minutes when Bellamy’s cross from the left was punched clear by Tuffey and fell kindly for Ramsey 15 yards out to rifle a ferocious shot high into the net.
Wales could have doubled their lead shortly after the restart when Collison teed up the shot for Bellamy but he blasted high and wide from distance, before sending a free-kick swerving across goal and past the upright.
That proved to be his last chance to add his name to the scoresheet when he was replaced by Earnshaw after an hour, with Collison swapped for Owain Tudur Jones.
Earnshaw – who netted against Scotland on Wednesday night – doubled Wales’ advantage with 69 minutes gone when he collected from David Cotterill, turned and lashed past the grasp of Tuffey from 20 yards.
There was no way back for Northern Ireland and they finished bottom of the group, with Scotland and the Republic set to contest the silverware in the competition’s climax on Sunday night.