The Dutch, with injured coach Louis van Gaal watching from the stands in Rotterdam, only needed a point to top Group G and came through a nervy encounter to finish two points clear of second-placed Turkey, who pipped Norway to a play-off spot.
Tottenham winger Bergwijn smashed Arnaut Danjuma’s cross into the top corner with six minutes left at De Kuip.
Barcelona’s Depay then made it two a minute into injury time as he slotted home Bergwijn’s pass to seal the Netherlands a return to the tournament after missing out on Russia in 2018.
The victory was played behind closed doors after a partial lockdown was re-introduced last week due to an increase in cases of Covid-19.
“Of course there are many things that could be improved, but the result was the most important. We are going to Qatar,” Oranje captain Virgil van Dijk told broadcasters NOS.
“I was very sorry that the national coach was there from a distance and the fans were not there at all. We’re going to celebrate well inside (the stadium). I can’t wait for the World Cup.”
In Podgorica, Montenegro forward Fatos Beqiraj opened the scoring after just four minutes to put Turkey in danger of missing out on a top-two finish.
The visitors responded on 22 minutes as Galatasary attacker Kerem Akturkoglu finished acrobatically at the back post before Feyenoord youngster Orkun Kokcu added a second to secure a 2-1 win.
“There are very tough opponents in the play-offs,” Turkey’s Abdulkadir Omur said after assisting Akturkoglu’s equaliser.
“We want to give the best fight there and go to the World Cup. I am very happy and proud in this shirt, I do everything I can.”
The Netherlands join Belgium, England, Germany, Denmark, France, Croatia, Switzerland, Spain and Serbia to have qualified directly from Europe.
In the play-offs, Turkey are alongside Euro 2020 winners Italy, Portugal, Scotland, Russia, Sweden, Poland, Wales, North Macedonia, Ukraine, the Czech Republic and Austria, with the draw on November 26 for the games in March.
Elsewhere, in Group E, Wales secured a home game in the play-offs after a 1-1 draw in Cardiff against Belgium without injured captain Gareth Bale.
“It’s so important to get a home draw — look at the teams that have come in second, the likes of Portugal and Italy it’s been a bit nervy!” Wales goalscorer Kieffer Moore told Sky Sports.
“But nights like this, I’d back us to take on anyone.”
In Group D, Finland missed out on the play-offs as Karim Benzema and Kylian Mbappe scored in World Cup holders France’s 2-0 win in Helsinki.
The pair became the first France players to score in four successive Les Bleus games since David Trezeguet in 2003.
Ukraine took the play-off spot after beating Bosnia and Herzegovina by the same scoreline thanks to Oleksandr Zinchenko and Artem Dovbyk’s second-half efforts in Zenica.