Minors often declare war on much larger neighbours if said neighbours are being beat down by other majors. I once watched Bar (That's a OPM in western HRE) DOW France and actually take 3 provinces. (France had previously been steamrolled by Burgundy, Austria and Castille in a row).
Since Mamluks tend to get attacked by other Arabian nations and exspecially Ottomans alot (and actually I rarely see a game where they actually survive), I'm not surprised to see Tripoli jumped at the chance of expanding.