In information theory, mutual information characterizes the maximal gain in wealth growth rate due to knowledge of side information on a gambling result; the betting strategy that achieves this maximum is named the Kelly criterion. In physics, it was recently shown that mutual information characterizes the maximal amount of work that can be extracted from a single heat bath using measurement-based control protocols; extraction that is done using 'information engines'. However, to the best of our knowledge, no relation between gambling and information engines has been presented before. In this paper, we briefly review the two and then show an analogy between gambling, where bits are converted into wealth, and information engines, where bits representing measurements are converted into energy. From this analogy follows an extension of gambling to the continuous-valued case, which can be useful for investments in the stock market using options. Moreover, the analogy enables us to use well-known methods and results from one field to solve problems in the other. We present three such cases: maximum work extraction when the probability distributions governing the system and measurements are unknown, work extraction when some energy is lost in each cycle, e.g., due to friction, and an analysis of systems with memory. In all three cases, the analogy enables us to use known results in order to obtain new ones.