So you're the winning bidder all week until the last 5 seconds when someone shoots in and outbids you. Is there anything to help prevent that from happening or is that just a fact of web auctions?
Bid the real maximum price you're willing to pay, then if you lose you don't mind because you didn't want to spend that much anyway.
As for a real answer, I don't think there's a trick beside bidding at the last second too.
Those people that outbid you might be using an eBay sniper application which places bids at the closing seconds of an auction (e.g. gixen.com). You could use one of these utilities yourself.
Unfortunately, using these snipers is actually better for the bidder than using eBay's functionality (auto bidding) since you can keep your interest in the item, and the amount you are willing to pay, a secret up to the last seconds of the bid. By using eBay's feature, someone can figure out what your maximum bid is by placing a higher bid incrementally. It's unfortunate, since it makes sniping apps required to win some bids at a reasonable price.