York City and Dorking Wanderers will play in the National League next season.
York won promotion with a 2-0 victory at home to Boston United in the National League North play-off final.
And in the National League South play-off final, Dorking won 3-2 in an extraordinary game at home to Ebbsfleet United.
Rakish Bingham put Ebbsfleet ahead and James McShane equalised before an injury-time goal by Craig Tanner looked like taking the Kent side up.
However, Luke Moore levelled for the visitors with seconds remaining to force extra time, and Alfie Rutherford scored a dramatic winner.
Dorking will see their promotion as justice given that they were five points clear at the top of the table when last season was cancelled because of the Covid-19 pandemic.
In the battle of two former Football League clubs, goals from Lenell John-Lewis and Maz Kouhyar were enough to end York's five-year stay in the sixth tier.
Boston searched in vain for an equaliser after John-Lewis' first-half opener, before Kouhyar's late goal sealed victory for the Minstermen.