The victory has taken Aitor Karanka's side two points above second-placed Burnley, while Wolves, whose goal came in the 89th minute, have dropped one place into 14th.
The home side had a chance to take the lead inside two minutes when Albert Adomah drove into the Wolves box, but his low effort was just wide of the post. In the sixth minute, Adomah had a go from distance, but once again missed the far post.
Ramirez then turned provider for Jordan Rhodes in the 28th minute when the Uruguay international delivered a cross onto the head of the striker, but Wolves managed to clear for a corner.
The visitors had a half-chance five minutes before the end of the first period when Nathan Byrne struck one from distance, but his effort was always rising over the crossbar.
Middlesbrough almost had their second just 30 seconds into the second period when Adomah set up Rhodes with a cross from the left, but Carl Ikeme was on hand to make an excellent one-handed save.
The hosts did double their lead in the 56th minute, however, when Ramirez bent an effort into the far corner to send the Middlesbrough supporters into jubilation.
Adomah's constant movement in a wide position continued to cause Wolves problems in the second half, while George Friend came close to a third for Boro on a couple of occasions.
Rhodes continued to search for a goal late on, but the former Blackburn Rovers player could not register due to some wasteful finishing. Instead, it was Wolves that scored the game's third goal in the 89th minute when Joe Mason's close-range header deflected off Ben Gibson and into the back of the net.
It was too little too late, however, as Middlesbrough, who return to action with a trip to Rotherham United on Tuesday, held on for all the points and returned to the top of the pile in the process.