After a scrappy first half ended goalless, Wells sparked the game into life with a well-taken goal to round off a sharp counter-attack shortly after the break.
And moments after Shaun Hutchinson had equalised for the hosts, the striker was gifted his second thanks to a dreadful error by goalkeeper Bialkowski.
There was little sign of the drama to come in a first half full of intensity and tough tackling, but lacking in quality. Comfortably the best chance fell to Rangers' top scorer Jordan Hugill, when Ilias Chair's cross fell perfectly for him 12 yards out, but his shot was blocked by a Millwall captain Alex Pearce, who threw himself into its path.
That was the only opportunity of note in a half that saw more shots land in the upper tier than work the goalkeepers.
Shane Ferguson's mis-hit cross – easily claimed at his near post by Joe Lumley – was the closest Millwall came to scoring, while Wells had an effort on target for the visitors, a tame shot from the corner of the box deflected into the hands of Bialkowski.
Millwall seemed to have started the second half brighter, with Jed Wallace and Jon Dadi Bodvarsson both forcing Lumley into saves, but it was Rangers who were able to find a way ahead just 10 minutes after the break.
Wells led the counter himself following a Millwall corner, and just when it looked as if the move had broken down the ball fell back to the striker, who lashed it into the corner.
The home side responded, as always felt likely, with a set piece. Hutchinson had already provided a warning, heading powerfully at Lumley from one corner, and he made the next one count, reacting quickest to poke the ball home from close range.
Parity lasted just seconds, however, as Bialkowski's howler allowed Wells a second. The keeper charged needlessly out of his goal to deal with an aimless ball over the top, mis-controlled under almost no pressure, and could only watch as the ball rolled for Wells to tap into an empty net.
Millwall had chances to get back into the game, but Wallace fired wide when one-on-one and saw another effort charged down in the final minutes, while Aiden O'Brien and Tom Bradshaw both headed over late on.
The result leaves QPR just a point off the top of the Championship, while Millwall are without a win in six games.