Gareth Bale marked his debut as Wales' youngest international by setting up their late winner against England's World Cup opponents in Graz, Austria.
Earnshaw produced two instinctive finishes to give Wales victory
Southampton left-back Bale broke Lewin Nyatanga's record when he came on as a substitute aged 16 years and 315 days.
Coventry's Stern John had put Trinidad in front on 32 minutes, only for Rob Earnshaw to equalise six minutes later.
John and Collin Samuel then went close for Trinidad, but Earnshaw converted Bale's low cross to give Wales victory.
Trinidad goalkeeper Kelvin Jack had nothing to do in the second half as a youthful Wales struggled to create any scoring opportunities, and he was caught cold with Earnshaw's near-post effort.
The Soca Warriors looked far more comfortable than Wales in possession as the game developed, but they showed little that would concern England manager Sven-Goran Eriksson.
Wales manager John Toshack - who again opted for his favoured 3-5-2 formation - used the occasion to continue his policy of blooding youngsters into the side.
He started with debutant Jason Brown in goal - the first of four debutants on the night - while Bristol City striker David Cotterill started for the first time as he won only his third cap.
Cotterill, 18, had his opportunity in the absence of captain Ryan Giggs and Craig Bellamy to partner Earnshaw up front.
And Earnshaw had a great chance to put Wales ahead in the opening minute when he latched on to a sloppy Trinidad pass.
But he delayed too long and the Trinidad defenders recovered and blocked his shot.
Bale showed his class to set up Earnshaw for Wales' winner
The Soca Warriors quickly recovered from that early scare, as Chris Birchall and Carlos Edwards warmed Brown's hands with long-range efforts inside the first 15 minutes.
Cotterill then forced a great fingertip save from Trinidad goalkeeper Kelvin Jack when his 20-yard effort looked destined for the left corner.
The match lacked any real urgency, with many players at walking pace - but a rare physical challenge led to John's opening goal.
Trinidad won a free-kick in Wales' right corner and Coventry striker Stern latched on to Birchall's far-post cross to stab the ball home with his shin.
The lead lasted only six minutes, though, as Earnshaw responded quickest to James Collins' knock-down to score from six yards out for his 10th international goal.
Leyton Orient's Glyn Garner become Wales' second debutant as he replaced Brown in goal for the second half.
Striker Craig Davies, midfielder Andrew Crofts and defender Nyatanga also come on as Cotterill, Carl Fletcher and David Partridge made way.
Manger John Toshack continued to make the changes as Bale made history when he replaced David Vaughan after 54 minutes.
All the changes sucked away any sort of rhythm in Wales' play as the ball was lost far too easily on numerous occasions in Trinidad territory.
Trinidad posed by far the greater attacking threat as Wales captain Gabbidon was forced into a last-gasp block to deny John on the hour.
Substitute Collin Samuel then saw his powerful header sail inches wide from the resulting corner and Russell Latapy also went close with a curling, right-foot effort.
Yeovil's 17-year-old striker Arron Davies became Wales' fourth debutant when he replaced Simon Davies 15 minutes from time.
Trinidad continued to looked the most potent attacking threat, but a rare breakaway down the left wing opened space for Bale to deliver a perfect low cross that Earnshaw forced home in the 87th minute.
Wales: Brown (Garner 46), Robinson, Ledley, Gabbidon, Collins, Partridge (Nyatanga 46), Fletcher (Crofts 46), Earnshaw, Cotterill (Craig Davies 46), Simon Davies (Arron Davies 78), Vaughan (Bale 55).
Subs Not Used: Wiggins.
Goals: Earnshaw 38, 87.
Trinidad and Tobago: Jack, Avery John, Andrews (Samuel 35), Lawrence, Birchall, Gray, Edwards, Stern John, Jones (Latapy 62), Theobold (Whitley 77), Yorke.
Subs Not Used: Cox, Sancho, Charles, Glenn, Scotland, Ince, Wolfe, Wise.
Goals: Stern John 32.
Ref: Stefan Messner (Austria).