Second-half changes from Enzo Maresca were the difference maker in a surprisingly close battle in Wales.