Judge M.N.A Gaffoor also ordered the cricketer to pay a fine of 500,000 rupees (4,716 US dollars) that would go to two charities.
Lokuarachchi, 25, pleaded guilty to killing the pedestrian and injuring her son in a late-night car crash in August 2003.
The judge said the player would not have to serve time as he was "suspending" the sentence for five years.
If the offence is repeated within the next five years, the player would be jailed for the four-year term.
The leg-spinner, who has played 21 one-day internationals and four Tests, was banned for four months by Sri Lanka Cricket on disciplinary grounds following the car crash.