The win means Aliou Cisse's side finish second in Group A, setting up a last-16 meeting with Group B winners England on Sunday (19:00 GMT).
All three goals came from players based in England as Ecuador's Brighton midfielder Moises Caicedo cancelled out a penalty by Watford's Ismaila Sarr before Chelsea defender Koulibaly's side-footer won it.
Ecuador needed just a point to progress but paid the price...