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 playoff 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 playoffs," 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."