No, your idea is not the right approach if you really want to stay. As noted in another answer, if you come in with a competitive job offer many companies will simply show you the door. But even if they don't, extracting pay raises under such circumstances are almost always counter-productive in the long run if you decide to stay. You gain a short-term increase at the expense of longer-term opportunities and increases.
I suggest that your best approach is twofold:
Research the current and local market and find out what people with similar skills and experience are being paid. You should be able to come up with a compensation range. Assess where you fall into that range. The lower you rank the better for you in the process.
Carefully document what your contributions are worth to the company. This can be difficult and time-consuming but it's the most important part of this process. Detail problems you have solved, clients you have brought in or retained, whatever it is you have done and put a price tag on it. Also figure out what it would cost the company, both in direct hiring costs, training and so on to replace you but also lost opportunity by having a less experienced person filling your spot.
Using that information put together a 1 or 2 page presentation that you can pitch in 5 minutes or less. (Similar to the "elevator pitch" they teach you in sales training.) But have backup documentation ready and with you so that you can pull it out and defend anything in your presentation.
Now you are prepared for a salary discussion. Press the issue with your manager. If you have to, camp out at their office until you get a meeting. Many manager dislike such discussions because they get tired of the usual "I deserve a raise because stuff is so expensive now..." That's NOT the company's problems, it's yours. Your presentation will be a refreshing change from the usual salary conversation and, if you are well prepared, things should go well.
If not, well you now have some fantastic material for an interview with another company. But leave that until later if its needed.
Never "threaten" your manager with "give me a raise or I'll leave". You want to have a very positive meeting and leave them feeling really good about you, your work, your attitude, and your future with the company.