A new series of pyridine, thiazole, and pyrazole analogues were synthesized. The pyridone analogues 4a-e were synthesized by treating N-aryl-2-cyano-3-(4-(diphenylamino)phenyl)acrylamides 3a-e with malononitrile. Many 4-arylidene-thiazolidin-5-one analogues 6a-d were obtained by Knoevenagel reactions of 4-(diphenylamino)benzaldehyde (1) with their corresponding thiazolidin-5-one derivatives 5a-d. The structural elucidation of the products was proven by the collections of spectroscopic methods such as IR, 1H NMR, 13C NMR, and MS data. Their anti-cancer activity was examined against two cell lines, MDA-MB-231 (mammary carcinomas) and A-549 (lung cancer). Compared with cisplatin as a reference standard drug, 6-amino-4-(4-(diphenylamino)phenyl)-2-oxo-1-(p-tolyl)-1,2-dihydropyridine-3,5-dicarbonitrile (4b) and 6-amino-4-(4-(diphenylamino)phenyl)-1-(4-nitrophenyl)-2-oxo-1,2-dihydropyridine-3,5-dicarbonitrile (4e) exhibited better efficiency against the A-549 cell line, with IC50 = 0.00803 and 0.0095 μM, respectively. Also, these compounds 4b and 4e showed the most potency among the examined compounds against MDA-MB-231 with IC50 = 0.0103 and 0.0147 μM, respectively. The newly synthesized compounds were docked inside the active sites of the selected proteins and were found to demonstrate proper binding. 2-Cyano-2-(4,4-(diphenylamino)benzylidene)-5-oxo-3-phenylthiazolidin-2-ylidene)-N-(p-tolyl)acetamide (6c) offered the highest binding affinity (− 8.1868 kcal/mol) when docked into (PDB ID:2ITO), in addition to 2-cyano-N-(4-(diethylamino)phenyl)-2-(4-(4-(diphenylamino)benzylidene)-5-oxo-3-phenylthiazolidin-2-ylidene)acetamide (6a) gave the highest energy score (− 9.3507 kcal/mol) with (PDB ID:2A4L).