Meeting supporters after Simon Lightwood was elected the city's new MP, the Labour leader said campaigners had "smashed it" and called the result "a vindication of all of our hard work over the last two years".
He said: "When we soon form that next Labour government, Wakefield will go down as the birthplace of that."
Mr Lightwood defeated the Conservative candidate, Nadeem Ahmed, overturning the 3,000-vote majority secured by the Tories in 2019 to win by almost 5,000 votes.
On a bad night for Boris Johnson, the Conservatives also lost a by-election in Tiverton and Honiton, Devon, where the Liberal Democrats overturned a huge 24,000 Tory majority.
The results prompted the resignation of Oliver Dowden as Conservative chair, as he said someone "must take responsibility" for the recent run of poor electoral performances.
After the results were announced this morning, the Prime Minister, who is currently in Rwanda, said he recognised that voters are "going through a tough time at the moment", and said he will "listen" to voters but "keep going".
"It's absolutely true that we've had some tough by-election results and they've been, I think, a reflection of a lot of things but we've got to recognise that voters are going through a tough time at the moment and as a government I've got to listen to what people are saying," he said.
But, speaking in Wakefield, Sir Kier said time was running out for Mr Johnson.
"What a judgement this is on the Tories and Boris Johnson," he said. "Out of touch, out of ideas and if they had any decency they would get out of the way for the sake of the country."
He said the win in Wakefield was a "huge result for the Labour Party", adding: "This puts us now absolutely on track for a Labour government, which is absolutely coming."
Mr Lightwood also addressed supporters, saying: "We did it, we turned Wakefield red again. Giving the people of Wakefield back their voice in parliament. Now it's time to get on with the job."
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know.