Jali netted in a strong first half for the visitors, who will complete their short tour of Central America with a match against Honduras on Tuesday.
Bafana Bafana previously defeated 42nd-ranked Costa Rica 2-1 in their only other meeting in 2003, with Shakes Mashaba also in charge of the national team on that occasion.
In an open contest, Bafana captain Itumeleng Khune nearly gifted the 2014 World Cup quarter-finalists an early opener, as his poor clearance was hastily turned into a chance for Arsenal's Joel Campbell. However, Khune made amends by blocking Campbell's powerful strike from the edge of the area.
Mashaba's men responded with interest in the ninth minute, largely through the efforts of Jali. The Oostende man won the ball in midfield, played a one-two with Thulani Serero, before cooly lobbing Real Madrid goalkeeper Keylor Navas from inside the box for his second ever international goal.
While Bafana played some attractive football in the final third, Costa Rica looked dangerous on the counter. This was on display when Marco Urena forced Khune into a save at his near post after out-pacing teenage defender Rivaldo Coetzee midway through the first stanza.
Bafana nearly doubled their lead in the 53rd minute, but Serero's weak shot was kept out by Navas following a beautiful touch in the box by Sibusiso Vilakazi.
At the other end, the lively Urena flashed a menacing strike on the turn narrowly wide of Khune's goal around the hour-mark.
Urena threatened again in the 66th minute as his attempt from an acute angle was turned away by Khune.
The hosts continued to press but 73rd-ranked Bafana held firm, with Mashaba also handing game-time to Mzikayise Mashaba, Kamohelo Mokotjo, Thulani Hlatshwayo and Ayanda Patosi at the expense of debutant Mosa Lebusa, Vilakazi, George Lebese and Serero.
Costa Rica XI: Navas, Acosta, Calvo (Aguilar 55’), Borges, Duarte, Venegas (Colindres 61’), Campbell, Oviedo, Gamboa, Tejeda (Guzman 73’), Urena (Matarrita 90’).
Unused Subs: Alvarado, Pemberton, Diaz, Waston, Myrie, Granados, Castillo, Vega.
Bafana XI: Khune, Ngcongca, Coetzee, Mathoho, Lebusa (M. Mashaba 59'), Jali, Zungu, Masango, Serero (Patosi 87'), Lebese (Hlatshwayo 78'), Vilakazi (Mokotjo 70').
Unused Subs: Mabokgwane, Williams, Nhlapo, Daniels, Furman, Shongwe.