It's shown that people who go to DS9 have some latinum, as Riker complains in one TNG episode that Quark instead gave him a voucher that could only be used at quarks when he won at dabo, rather than latinum which can be used "anywhere".
it is assumed that they have some sort of credit system for just this kind of situation.
As Sisko points out the Federation are Quark's "landlords" who don't charge him for energy, repairs etc etc,
one would assume that the least Quark can do is to buy Starfleet officers a round once in a while.
At the end of the day it's Starfleet energy powering the replicators, whether they're on command level or not.