(FTR, in the linked-to shiur the speaker [which, from his voice, sounds like R. Eli Mansour] refers to the “Yayin Ha-meshumar that was written in the 1800s” - except he’s off by 150+ years.)
In the 16th century there was a great controversy surrounding the lenient attitude of Moravian Jews, among others, with regards to the consumption of stam yeinam (wine that came in contact with a gentile). To make things worse, R. Moses Isserles penned a responsum (Shu”t Rema §124) grasping to justify their prevalent attitude, though he explicitly added that the attitude should not be followed. This caused quite a frenzy among the halachists of that era (to the extent that the responsum was omitted in some editions of his responsa and subsequently rejected as a forgery by some halachic commentators).
At the behest of many rabbis, R. Nathan Spira, a highly respected rabbi and Kabbalist, authored Yayin HaMeshumar (published first in 1660) detailing the severity regarding these laws both in Jewish law and mysticism. The book carried the approbations of many important rabbis and attached letters of previous rabbis who spearheaded the polemic; R. Josef Karo, to mention one.
The second book, Ayuma KaNidgalot was written by R. Isaac Onkeneira and first published in Constantinople 1577. Contrary to the aforementioned shiur-giver, I wouldn’t exactly classify the book as he calls it “a sefer mussar” (book on ethics). It appears to be a hodgepodge of dubious Midrashim (cf. S. C. Kook’s ‘Iyunim uMechkarim vol. 1, 247ff.), some sprinkling of mysticism, philosophy and ethical lessons in the framework of alphabetic-style poetry. (Kook, ibid., and Isaac Meisles, Tagim 1975 v., p. 43, suggest that the core work is an imitation of the poem by the 15th century scholar R. Solomon Sharbit HaZahav.)
The material germane to the Ben Ish Chai’s discussion on stam yeinam, at OP’s link, is a story the author repeats as told by his father, R. Yehudah (p. 24a). Briefly put: a king invited rabbis to a feast and bid them to demonstrate their loyalty to him by partaking in one of three things: drinking his wine, committing adultery or eating food cooked by his gentile staff (bishul akum). After their reckoning they decided the most lenient option would be to drink the wine [as it was at most stam yeinam and not yayin nesech]. While at the feast and the rabbis were intoxicated the king had the round table shifted and they ate from his food instead of their kosher food and subsequently engaged in adultery, unintentionally, in their intoxicated state. Lesson: even men of stature must be careful consuming wine. (Indeed, the preface to the story is not focused on stam yeinam rather on the good/bad of wine in general.)