Posh were in need of reinforcements up front after club-record signing Tyrone Barnett and Emile Sinclair were placed on the transfer list - and subsequently loaned out to Ipswich and Barnsley respectively - following a breach of club discipline.
It is understood a deal was already in place between the two clubs for Gayle, 22, to join Peterborough at the end of the current season.
Posh chairman Darragh MacAnthony said on Twitter: "Some business moved forward now with signing of young Dwight Gayle who has joined us until the start of January. He is an energetic, pacy, strong striker.
"Everyone at the club is excited to have Dwight join us and we have no doubt he will be a big fans' favourite. Thanks to Dagenham & Redbridge for doing business!"
Gayle is a former Arsenal trainee and has scored seven goals for the Daggers this season.