Troicki hit 13 aces and converted two of his five break points to record his first win in four attempts against Ferrer.
The Serb will next face sixth-seeded Santiago Giraldo of Colombia, who beat qualifier Thanasi Kokkinakis of Australia 6-4, 6-3.
Giraldo withstood 11 aces from Kokkinakis, who was playing just his eighth tour-level match.
Lacko beat Ricardas Berankis of Lithuania 6-4, 7-6 (1). The Slovakian saved four of the five break points he faced to earn his 14th tour-level win of the season.