This is a difficult question for many reasons. One reason is likely because most of the introductory thermodynamics textbook problems that we are familiar with from childhood do not involve gravity.
To illustrate this difficulty with gravity consider, for example, this snippet from an article in the New York Times Review of Books by physicist/mathematician Freeman Dyson regarding the heat death of the universe:
The belief in a heat death was based on an idea that I call the
cooking rule. The cooking rule says that a piece of steak gets warmer
when we put it on a hot grill. More generally, the rule says that any
object gets warmer when it gains energy, and gets cooler when it loses
energy. Humans have been cooking steaks for thousands of years, and
nobody ever saw a steak get colder while cooking on a fire. The
cooking rule is true for objects small enough for us to handle. If the
cooking rule is always true, then Lord Kelvin’s argument for the heat
death is correct.
We now know that the cooking rule is not true for objects of
astronomical size, for which gravitation is the dominant form of
energy. The sun is a familiar example. As the sun loses energy by
radiation, it becomes hotter and not cooler. Since the sun is made of
compressible gas squeezed by its own gravitation, loss of energy
causes it to become smaller and denser, and the compression causes it
to become hotter. For almost all astronomical objects, gravitation
dominates, and they have the same unexpected behavior. Gravitation
reverses the usual relation between energy and temperature. In the
domain of astronomy, when heat flows from hotter to cooler objects,
the hot objects get hotter and the cool objects get cooler. As a
result, temperature differences in the astronomical universe tend to
increase rather than decrease as time goes on. There is no final state
of uniform temperature, and there is no heat death. Gravitation gives
us a universe hospitable to life. Information and order can continue
to grow for billions of years in the future, as they have evidently
grown in the past.
The point here is that, as a star loses energy via radiation, it actually increases in temperature. I.e., As it decreases in entropy (because $\delta S=\delta Q/T$) it actually increases in temperature! This is due to the gravitational attraction acting on the star and the fact that gravity is the most important contributor to the total energy of the star. This is a very unfamiliar situation, indeed.
I must also point out, however, that the total entropy of the star and the body being heated by the star will, actually, increase if the body being being heated is at a lower temperature than the star. The argument for this is standard.
But, nevertheless, we see that a star can both decrease in entropy and increase in temperature. Thus, as a star dies, the star tends to a states of lowest entropy and highest temperature. Again, the star is not an isolated system, so the total system is still tending towards higher entropy.
Additionally, this example is not exactly what you want because the direction of time in the example is opposite what you are looking for.
So, this answer, doesn't really answer your question. But I think it could be helpful to illustrate a counter-intuitive aspect of thermodynamic systems with gravity.
I don't know the full answer. It is apparently fairly complex and may or may not depend on cosmological inflation theory, about which I have long since forgotten everything I ever learned...