The incident you are referring to involves Sai Baba, not Gajanan Maharaj. According to the account in Chapter 14, after Ratanji arrived in Shirdi and made his offerings, Sai Baba immediately asked him for Dakshina, or an offering of money. The text clarifies this was a common practice of Sai Baba's with all visitors, whether Hindu, Muslim, or Parsi. He would ask for amounts as He pleased, sometimes demanding large sums and even telling devotees to take a loan if they had no money. This act of asking for Dakshina was a characteristic method of Sai Baba's, often seen as a test of a devotee's faith and surrender, but it was Sai Baba who made this demand of Ratanji, not Gajanan Maharaj.
How did Gajanan Maharaj test Ratanji by demanding Dakshina when he came seeking a blessing for a son?
π Chapter 14