Fulham triumphed 3-1 over Liga Deportiva Alajuelense, where Ruiz made his professional debut a decade ago.
Steve Sidwell opened the scoring after the hour mark with a clinical header from a Ruiz corner only for the home side to pull level 10 minutes later as Allen Guevara wriggled free in the box to finish past Maarten Stekelenburg.
Martin Jol’s side responded almost immediately as substitute Alexander Kacaniklic raced into the box where he was fouled by Elias Palma. Dimitar Berbatov despatched the penalty into the bottom corner.
Ruiz, who scored 21 goals in 66 games for Deportiva before leaving for Genk in Europe seven years ago, put the gloss on an emotional return three minutes from time, scoring at the near post.
Fulham will face Deportivo Saprissa on Saturday in their final match in Central America before matches against Werder Bremen, Real Betis and Parma back in Europe.