Wiles joined the Holy Blues from Tadcaster Albion, and becomes the first player of the current playing squad to pledge his allegiance to Trinity.
"I’m delighted that Alex has committed his immediate future to the football club," said manager Curtis Woodhouse.
"Alex has made a real impact since signing and will have a big part to play, not only in the remainder of this season, but as I shape the squad for next season and beyond as we try to get Gainsborough Trinity fighting at the right end of the table."
Keep up-to-date with our exclusive email newsletters.
Subscribe