I warmly recommend Coppock & Champollion (2020). It's free, very accessibly written and essentially a formally precise version of Heim & Kratzer's style. It also comes with a computer program students can use to get feedback on their solutions to exercises.
If you want a rather concise introduction, Winter (2016) might be worth taking a look at.
Heim & Kratzer (1998) is a classic on the syntax-semantics interface, but I'm not a huge fan of it, because they use a kind of semi-formal notation without ever actually defining or even explaining such elementary concepts as lambda conversion, which I think is a bad thing to do in an introductory textbook.
Gamut (1991) is pretty good, the first volume provides an introduction to logic and the second volume is about intensional logic. It's perhaps a bit more technical than other introductions but doesn't fall short on detailed explanations. If you're specifically interested in intensional logic, type theory and Montague semantics and not so much a broader coverage of semantic topics, that one could be the first place to go.
Specifically for Montague grammar, Dowty, Wall & Peters (1981) could be said to be the standard reference. In order to make good use of it, it probably makes sense to have had some prior introduction to logic and formal semantics first.
To get an overview of the various topics semantics deals with, Kearns (2011) is a good place to start; if you're new to linguistic semantics it could be worth to start with the first chapter there before diving into the formal stuff, but for the latter other books are more suitable.
Coppock, Elizabeth & Champollion, Lucas (2020). Invitation to formal semantics. Manuscript, 20 August 2020 edition.
Dowty, David R., Wall, Robert & Peters, Stanley (1981). Introduction to Montague semantics. Springer Science & Business Media.
Gamut, LTF (1991). Logic, language, and meaning, Volume 1: Introduction to logic. University of Chicago Press.
Gamut, LTF (1991). Logic, language and meaning, Volume 2: Intensional logic and logical grammar. University of Chicago Press.
Heim, Irene & Kratzer, Angelika (1998). Semantics in generative grammar. Blackwell Oxford.
Kearns, Kate (2011). Semantics. Palgrave Macmillan, 2nd edition.
Winter, Yoad (2016). Elements of formal semantics: An introduction to the mathematical theory of meaning in natural language. Edinburgh University Press.