Maidenhead saw off struggling Dorking 4-2 at York Road to pull clear of the Vanarama National League relegation zone.
Sam Beckwith gave Maidenhead the lead with a low shot into the bottom corner after 10 minutes, but Charlie Carter soon fired Dorking level.
The Magpies were back in front in the 28th minute through a long-range effort by Reece Smith and winger Jayden Mitchell-Lawson added a third with a fine solo effort just before the break.
Wanderers reduced the deficit in the 66th minute when Jason Prior headed in following a swift counter-attack, but Tristan Abrahams scored late fourth for Maidenhead, who climb to 16th.
Subscribe or register today to discover more from DonegalLive.ie
Buy the e-paper of the Donegal Democrat, Donegal People's Press, Donegal Post and Inish Times here for instant access to Donegal's premier news titles.
Keep up with the latest news from Donegal with our daily newsletter featuring the most important stories of the day delivered to your inbox every evening at 5pm.